Introduced simplified interface for creation of algobase

This commit is contained in:
Alejandro Saucedo 2020-08-31 09:35:40 +01:00
parent 13206a9d9b
commit f29e56fcb8
4 changed files with 173 additions and 23 deletions

View file

@ -10,7 +10,7 @@ TEST_CASE("op_custom_simple_raw_shader") {
std::shared_ptr<kp::Tensor> tensorA{ new kp::Tensor({ 3, 4, 5 })};
std::shared_ptr<kp::Tensor> tensorB{ new kp::Tensor({ 0, 0, 0 })};
mgr.evalOp<kp::OpCreateTensor>({ tensorA, tensorB });
mgr.evalOpDefault<kp::OpCreateTensor>({ tensorA, tensorB });
std::string shader(
"#version 450\n"
@ -24,11 +24,9 @@ TEST_CASE("op_custom_simple_raw_shader") {
"}\n"
);
mgr.evalOp<kp::OpAlgoBase<>>(
mgr.evalOpDefault<kp::OpAlgoBase<>>(
{ tensorA, tensorB },
"DEFAULT",
true,
"",
true, // Whether to copy output from device
std::vector<char>(shader.begin(), shader.end()));
REQUIRE(tensorA->data() == std::vector<uint32_t>{0, 1, 2});