Migrated default base type of tensor to float

This commit is contained in:
Alejandro Saucedo 2020-08-31 16:01:27 +01:00
parent 00c66f347b
commit 08a1300450
13 changed files with 255 additions and 249 deletions

View file

@ -38,7 +38,7 @@ TEST_CASE("End to end OpMult Flow should execute correctly from manager") {
spdlog::info("OpMult call success");
spdlog::info("Tensor output: {}", tensorOutput->data());
REQUIRE(tensorOutput->data() == std::vector<uint32_t>{0, 4, 12});
REQUIRE(tensorOutput->data() == std::vector<float>{0, 4, 12});
}
spdlog::info("Called manager eval success END PROGRAM");
@ -88,7 +88,7 @@ TEST_CASE("End to end OpMult Flow should execute correctly from sequence") {
spdlog::info("OpMult call success");
spdlog::info("Tensor output: {}", tensorOutput->data());
REQUIRE(tensorOutput->data() == std::vector<uint32_t>{0, 4, 12});
REQUIRE(tensorOutput->data() == std::vector<float>{0, 4, 12});
spdlog::info("Called manager eval success END PROGRAM");
}
@ -159,7 +159,7 @@ TEST_CASE("End to end OpMult Flow with OpCreateTensor called with multiple tenso
spdlog::info("OpMult call success");
spdlog::info("Tensor output: {}", tensorOutput->data());
REQUIRE(tensorOutput->data() == std::vector<uint32_t>{0, 4, 12});
REQUIRE(tensorOutput->data() == std::vector<float>{0, 4, 12});
spdlog::info("Called manager eval success END PROGRAM");
}

View file

@ -14,7 +14,7 @@ TEST_CASE("test_multiple_algo_exec_single_cmd_buf_record") {
std::string shader(
"#version 450\n"
"layout (local_size_x = 1) in;\n"
"layout(set = 0, binding = 0) buffer a { uint pa[]; };\n"
"layout(set = 0, binding = 0) buffer a { float pa[]; };\n"
"void main() {\n"
" uint index = gl_GlobalInvocationID.x;\n"
" pa[index] = pa[index] + 1;\n"
@ -45,7 +45,7 @@ TEST_CASE("test_multiple_algo_exec_single_cmd_buf_record") {
}
sqWeakPtr.reset();
REQUIRE(tensorA->data() == std::vector<uint32_t>{3, 3, 3});
REQUIRE(tensorA->data() == std::vector<float>{3, 3, 3});
}
TEST_CASE("test_multiple_algo_exec_multiple_record") {
@ -57,7 +57,7 @@ TEST_CASE("test_multiple_algo_exec_multiple_record") {
std::string shader(
"#version 450\n"
"layout (local_size_x = 1) in;\n"
"layout(set = 0, binding = 0) buffer a { uint pa[]; };\n"
"layout(set = 0, binding = 0) buffer a { float pa[]; };\n"
"void main() {\n"
" uint index = gl_GlobalInvocationID.x;\n"
" pa[index] = pa[index] + 1;\n"
@ -100,7 +100,7 @@ TEST_CASE("test_multiple_algo_exec_multiple_record") {
}
sqWeakPtr.reset();
REQUIRE(tensorA->data() == std::vector<uint32_t>{3, 3, 3});
REQUIRE(tensorA->data() == std::vector<float>{3, 3, 3});
}
@ -113,7 +113,7 @@ TEST_CASE("test_multiple_algo_exec_multiple_sequence") {
std::string shader(
"#version 450\n"
"layout (local_size_x = 1) in;\n"
"layout(set = 0, binding = 0) buffer a { uint pa[]; };\n"
"layout(set = 0, binding = 0) buffer a { float pa[]; };\n"
"void main() {\n"
" uint index = gl_GlobalInvocationID.x;\n"
" pa[index] = pa[index] + 1;\n"
@ -162,6 +162,6 @@ TEST_CASE("test_multiple_algo_exec_multiple_sequence") {
sq->eval();
}
REQUIRE(tensorA->data() == std::vector<uint32_t>{3, 3, 3});
REQUIRE(tensorA->data() == std::vector<float>{3, 3, 3});
}

View file

@ -9,7 +9,7 @@ TEST_CASE("test_opcreatetensor_create_single_tensor") {
kp::Manager mgr;
std::vector<uint32_t> testVecA{ 9, 8, 7 };
std::vector<float> testVecA{ 9, 8, 7 };
std::shared_ptr<kp::Tensor> tensorA{new kp::Tensor(testVecA)};
@ -27,8 +27,8 @@ TEST_CASE("test_opcreatetensor_create_multiple_tensors_single_op") {
kp::Manager mgr;
std::vector<uint32_t> testVecA{ 9, 8, 7 };
std::vector<uint32_t> testVecB{ 6, 5, 4 };
std::vector<float> testVecA{ 9, 8, 7 };
std::vector<float> testVecB{ 6, 5, 4 };
std::shared_ptr<kp::Tensor> tensorA{new kp::Tensor(testVecA)};
std::shared_ptr<kp::Tensor> tensorB{new kp::Tensor(testVecB)};
@ -46,8 +46,8 @@ TEST_CASE("test_opcreatetensor_create_multiple_tensors_multiple_op") {
kp::Manager mgr;
std::vector<uint32_t> testVecA{ 9, 8, 7 };
std::vector<uint32_t> testVecB{ 6, 5, 4 };
std::vector<float> testVecA{ 9, 8, 7 };
std::vector<float> testVecB{ 6, 5, 4 };
std::shared_ptr<kp::Tensor> tensorA{new kp::Tensor(testVecA)};
std::shared_ptr<kp::Tensor> tensorB{new kp::Tensor(testVecB)};
@ -64,8 +64,8 @@ TEST_CASE("test_opcreatetensor_create_multiple_tensors_multiple_op") {
TEST_CASE("test_opcreatetensor_manage_tensor_memory_when_destroyed") {
std::vector<uint32_t> testVecA{ 9, 8, 7 };
std::vector<uint32_t> testVecB{ 6, 5, 4 };
std::vector<float> testVecA{ 9, 8, 7 };
std::vector<float> testVecB{ 6, 5, 4 };
std::shared_ptr<kp::Tensor> tensorA{new kp::Tensor(testVecA)};
std::shared_ptr<kp::Tensor> tensorB{new kp::Tensor(testVecB)};
@ -88,8 +88,8 @@ TEST_CASE("test_opcreatetensor_manage_tensor_memory_when_destroyed") {
TEST_CASE("test_opcreatetensor_no_error_if_tensor_freed_before") {
std::vector<uint32_t> testVecA{ 9, 8, 7 };
std::vector<uint32_t> testVecB{ 6, 5, 4 };
std::vector<float> testVecA{ 9, 8, 7 };
std::vector<float> testVecB{ 6, 5, 4 };
std::shared_ptr<kp::Tensor> tensorA{new kp::Tensor(testVecA)};
std::shared_ptr<kp::Tensor> tensorB{new kp::Tensor(testVecB)};

View file

@ -17,8 +17,8 @@ TEST_CASE("test_op_shader_raw_data_from_constructor") {
std::string shader(
"#version 450\n"
"layout (local_size_x = 1) in;\n"
"layout(set = 0, binding = 0) buffer a { uint pa[]; };\n"
"layout(set = 0, binding = 1) buffer b { uint pb[]; };\n"
"layout(set = 0, binding = 0) buffer a { float pa[]; };\n"
"layout(set = 0, binding = 1) buffer b { float pb[]; };\n"
"void main() {\n"
" uint index = gl_GlobalInvocationID.x;\n"
" pb[index] = pa[index];\n"
@ -31,8 +31,8 @@ TEST_CASE("test_op_shader_raw_data_from_constructor") {
true, // Whether to copy output from device
std::vector<char>(shader.begin(), shader.end()));
REQUIRE(tensorA->data() == std::vector<uint32_t>{0, 1, 2});
REQUIRE(tensorB->data() == std::vector<uint32_t>{3, 4, 5});
REQUIRE(tensorA->data() == std::vector<float>{0, 1, 2});
REQUIRE(tensorB->data() == std::vector<float>{3, 4, 5});
}
TEST_CASE("test_op_shader_compiled_data_from_constructor") {
@ -50,8 +50,8 @@ TEST_CASE("test_op_shader_compiled_data_from_constructor") {
kp::shader_data::test_shaders_glsl_test_op_custom_shader_comp_spv +
kp::shader_data::test_shaders_glsl_test_op_custom_shader_comp_spv_len));
REQUIRE(tensorA->data() == std::vector<uint32_t>{0, 1, 2});
REQUIRE(tensorB->data() == std::vector<uint32_t>{3, 4, 5});
REQUIRE(tensorA->data() == std::vector<float>{0, 1, 2});
REQUIRE(tensorB->data() == std::vector<float>{3, 4, 5});
}
TEST_CASE("test_op_shader_raw_from_file") {
@ -66,8 +66,8 @@ TEST_CASE("test_op_shader_raw_from_file") {
true, // Whether to copy output from device
"test/shaders/glsl/test_op_custom_shader.comp");
REQUIRE(tensorA->data() == std::vector<uint32_t>{0, 1, 2});
REQUIRE(tensorB->data() == std::vector<uint32_t>{3, 4, 5});
REQUIRE(tensorA->data() == std::vector<float>{0, 1, 2});
REQUIRE(tensorB->data() == std::vector<float>{3, 4, 5});
}
TEST_CASE("test_op_shader_compiled_from_file") {
@ -82,6 +82,6 @@ TEST_CASE("test_op_shader_compiled_from_file") {
true, // Whether to copy output from device
"test/shaders/glsl/test_op_custom_shader.comp.spv");
REQUIRE(tensorA->data() == std::vector<uint32_t>{0, 1, 2});
REQUIRE(tensorB->data() == std::vector<uint32_t>{3, 4, 5});
REQUIRE(tensorA->data() == std::vector<float>{0, 1, 2});
REQUIRE(tensorB->data() == std::vector<float>{3, 4, 5});
}

View file

@ -4,15 +4,15 @@
#include "kompute/Kompute.hpp"
TEST_CASE("test_tensor_constructor_data") {
std::vector<uint32_t> vec{0,1,2};
std::vector<float> vec{0,1,2};
kp::Tensor tensor(vec);
REQUIRE( tensor.size() == vec.size() );
REQUIRE( tensor.data() == vec );
}
TEST_CASE("test_tensor_copy_from_other_tensor_host_data") {
std::vector<uint32_t> vecA{0,1,2};
std::vector<uint32_t> vecB{0,0,0};
std::vector<float> vecA{0,1,2};
std::vector<float> vecB{0,0,0};
std::shared_ptr<kp::Tensor> tensorA = std::make_shared<kp::Tensor>(
vecA,

View file

@ -25,7 +25,7 @@ namespace kp {
namespace shader_data {
static unsigned const char test_shaders_glsl_test_op_custom_shader_comp_spv[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x08, 0x00,
0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -40,28 +40,28 @@ static unsigned const char test_shaders_glsl_test_op_custom_shader_comp_spv[] =
0x05, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x47,
0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x49, 0x44, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00,
0x11, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x04, 0x00,
0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x62, 0x00, 0x00,
0x05, 0x00, 0x03, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x03, 0x00, 0x18, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00,
0x06, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x70, 0x61, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x1a, 0x00, 0x00, 0x00,
0x12, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x04, 0x00,
0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x62, 0x00, 0x00,
0x05, 0x00, 0x03, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x03, 0x00, 0x19, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00,
0x06, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x70, 0x61, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x1b, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x48, 0x00, 0x05, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x11, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x48, 0x00, 0x05, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00,
0x11, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
0x13, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00,
0x12, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
0x14, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00,
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x18, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1a, 0x00, 0x00, 0x00,
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x19, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00,
0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
0x1a, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x1b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x19, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x15, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
@ -73,23 +73,24 @@ static unsigned const char test_shaders_glsl_test_op_custom_shader_comp_spv[] =
0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
0x06, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x20, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x03, 0x00, 0x10, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x11, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x15, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00,
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x03, 0x00,
0x17, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00,
0x18, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
0x19, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
0x3b, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1c, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
0x06, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x2c, 0x00, 0x06, 0x00, 0x09, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
0x23, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x10, 0x00, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x03, 0x00, 0x11, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x12, 0x00, 0x00, 0x00,
0x11, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x15, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00,
0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x03, 0x00,
0x18, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00,
0x19, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
0x1a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
0x3b, 0x00, 0x04, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1d, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
0x06, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x2c, 0x00, 0x06, 0x00, 0x09, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
0x25, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
@ -98,23 +99,25 @@ static unsigned const char test_shaders_glsl_test_op_custom_shader_comp_spv[] =
0x0c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
0x0f, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
0x08, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x1c, 0x00, 0x00, 0x00,
0x1d, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
0x1b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00,
0x1c, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
0x1f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x1c, 0x00, 0x00, 0x00,
0x22, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x22, 0x00, 0x00, 0x00,
0x21, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
0x06, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x1d, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00,
0x1c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
0x1f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00,
0x1d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
0x16, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
0x20, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
0x06, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x70, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00,
0x1d, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00,
0x16, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00,
0x38, 0x00, 0x01, 0x00
};
static unsigned const int test_shaders_glsl_test_op_custom_shader_comp_spv_len = 1068;
static unsigned const int test_shaders_glsl_test_op_custom_shader_comp_spv_len = 1096;
}
}
#endif // define SHADEROP_SHADERTEST_OP_CUSTOM_SHADER_HPP

View file

@ -1,7 +1,7 @@
#version 450
layout (local_size_x = 1) in;
layout(set = 0, binding = 0) buffer a { uint pa[]; };
layout(set = 0, binding = 1) buffer b { uint pb[]; };
layout(set = 0, binding = 0) buffer a { float pa[]; };
layout(set = 0, binding = 1) buffer b { float pb[]; };
void main() {
uint index = gl_GlobalInvocationID.x;
pb[index] = pa[index];