Migrated default base type of tensor to float
This commit is contained in:
parent
00c66f347b
commit
08a1300450
13 changed files with 255 additions and 249 deletions
|
|
@ -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});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue