Skip to content

Commit

Permalink
Make Memory::dataType static
Browse files Browse the repository at this point in the history
>
> Remove an unnecesary default template implementation which was causing all types to be treated as eCustom
> Should fix the release build
  • Loading branch information
robquill committed Aug 22, 2024
1 parent 1bfc6d5 commit ac52d6c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/include/kompute/Memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ class Memory
* @return Data type of T of type kp::Memory::DataTypes
*/
template<typename T>
DataTypes dataType()
{
return DataTypes::eCustom;
}
static DataTypes dataType();

/**
* Retrieve the data type of the tensor (int, float, unsigned short etc.)
Expand Down
2 changes: 1 addition & 1 deletion src/include/kompute/Tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class TensorT : public Tensor
device,
size,
sizeof(T),
this->dataType(),
Memory::dataType<T>(),
tensorType)
{
KP_LOG_DEBUG("Kompute TensorT constructor with data size {}", size);
Expand Down
2 changes: 1 addition & 1 deletion test/TestOpShadersFromStringAndFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct TestStruct
// Custom struct needs to be mapped the eCustom datatype
template<>
kp::Memory::DataTypes
kp::TensorT<TestStruct>::dataType()
kp::Memory::dataType<TestStruct>()
{
return Memory::DataTypes::eCustom;
}
Expand Down
2 changes: 1 addition & 1 deletion test/TestOpTensorCopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ TEST(TestOpTensorCopy, SingleTensorShouldFail)
std::runtime_error);
}

TEST(TestOpImageCopy, ImageShouldFail)
TEST(TestOpTensorCopy, ImageShouldFail)
{
kp::Manager mgr;

Expand Down
2 changes: 1 addition & 1 deletion test/TestTensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct TensorTestStruct
// Custom struct needs to be mapped the eCustom datatype
template<>
kp::Memory::DataTypes
kp::TensorT<TensorTestStruct>::dataType()
kp::Memory::dataType<TensorTestStruct>()
{
return kp::Memory::DataTypes::eCustom;
}
Expand Down

0 comments on commit ac52d6c

Please sign in to comment.