Skip to content

Commit

Permalink
Clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
robquill committed Aug 21, 2024
1 parent d44aa42 commit 5a9714c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ Image::~Image()
void
Image::reserve()
{
KP_LOG_DEBUG("Reserving {} bytes for memory", this->mSize * this->mDataTypeMemorySize);
KP_LOG_DEBUG("Reserving {} bytes for memory",
this->mSize * this->mDataTypeMemorySize);

if (this->mPrimaryImage || this->mPrimaryMemory) {
KP_LOG_DEBUG(
Expand Down
3 changes: 2 additions & 1 deletion src/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ Memory::unmapRawData()
void
Memory::updateRawData(void* data)
{
if (this->memoryType() != Memory::MemoryTypes::eStorage && data != nullptr) {
if (this->memoryType() != Memory::MemoryTypes::eStorage &&
data != nullptr) {
this->mapRawData();
memcpy(this->mRawData, data, this->memorySize());
}
Expand Down
3 changes: 2 additions & 1 deletion src/Tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ Tensor::~Tensor()
void
Tensor::reserve()
{
KP_LOG_DEBUG("Reserving {} bytes for memory", this->mSize * this->mDataTypeMemorySize);
KP_LOG_DEBUG("Reserving {} bytes for memory",
this->mSize * this->mDataTypeMemorySize);

if (this->mPrimaryBuffer || this->mPrimaryMemory) {
KP_LOG_DEBUG(
Expand Down
5 changes: 2 additions & 3 deletions src/include/kompute/Manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Manager
return tensor;
}

std::shared_ptr<Tensor> tensor(
std::shared_ptr<Tensor> tensor(
uint32_t elementTotalCount,
uint32_t elementMemorySize,
const Memory::DataTypes& dataType,
Expand Down Expand Up @@ -321,7 +321,7 @@ class Manager
{
return this->imageT<float>(width, height, numChannels, imageType);
}

std::shared_ptr<Image> image(
void* data,
size_t dataSize,
Expand Down Expand Up @@ -422,7 +422,6 @@ class Manager
return image;
}


/**
* Default non-template function that can be used to create algorithm
* objects which provides default types to the push and spec constants as
Expand Down
7 changes: 4 additions & 3 deletions test/TestTensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ TEST(TestTensor, ConstructorData)
TEST(TestTensor, ConstructorNoData)
{
kp::Manager mgr;
std::shared_ptr<kp::Tensor> tensor = mgr.tensor(
nullptr, 3, sizeof(float), kp::Memory::DataTypes::eFloat);
std::shared_ptr<kp::Tensor> tensor =
mgr.tensor(nullptr, 3, sizeof(float), kp::Memory::DataTypes::eFloat);
EXPECT_EQ(tensor->size(), 3);
EXPECT_EQ(tensor->dataTypeMemorySize(), sizeof(float));

Expand All @@ -36,7 +36,8 @@ TEST(TestTensor, ConstructorNoData)
TEST(TestTensor, ReserveData)
{
kp::Manager mgr;
std::shared_ptr<kp::Tensor> tensor = mgr.tensor(3, sizeof(uint32_t), kp::Memory::DataTypes::eUnsignedInt);
std::shared_ptr<kp::Tensor> tensor =
mgr.tensor(3, sizeof(uint32_t), kp::Memory::DataTypes::eUnsignedInt);
EXPECT_EQ(tensor->size(), 0);
EXPECT_EQ(tensor->dataTypeMemorySize(), sizeof(uint32_t));
}
Expand Down

0 comments on commit 5a9714c

Please sign in to comment.