Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the return type of multiply_image_and_position() #288

Merged
merged 4 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clic/src/tier1/multiply_image_and_position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ multiply_image_and_position_func(const Device::Pointer & device,
Array::Pointer dst,
int dimension) -> Array::Pointer
{
tier0::create_like(src, dst);
tier0::create_like(src, dst, dType::FLOAT);
const KernelInfo kernel = { "multiply_image_and_position", kernel::multiply_image_and_position };
const ParameterList params = { { "src", src }, { "dst", dst }, { "index", dimension } };
const RangeArray range = { dst->width(), dst->height(), dst->depth() };
Expand Down
21 changes: 21 additions & 0 deletions tests/tier1/test_multiply_image_and_position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ TEST_P(TestMultiplyPixelAndCoord, execute)
}
}

TEST_P(TestMultiplyPixelAndCoord, returnType)
{
std::string param = GetParam();
cle::BackendManager::getInstance().setBackend(param);
auto device = cle::BackendManager::getInstance().getBackend().getDevice("", "all");
device->setWaitToFinish(true);

for (cle::dType type : { cle::dType::UINT8,
cle::dType::INT8,
cle::dType::UINT16,
cle::dType::INT16,
cle::dType::FLOAT,
cle::dType::UINT32,
cle::dType::INT32 })
{
auto gpu_input = cle::Array::create(5, 3, 1, 3, type, cle::mType::BUFFER, device);
auto gpu_output = cle::tier1::multiply_image_and_position_func(device, gpu_input, nullptr, 0);
EXPECT_EQ(gpu_output->dtype(), cle::dType::FLOAT);
}
}

std::vector<std::string>
getParameters()
{
Expand Down
Loading