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

Refactor image and types #153

Merged
merged 5 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
49 changes: 0 additions & 49 deletions clic/include/core/cleImage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,55 +60,6 @@ class Image : public LightObject
ShapeArray shape_{ 1, 1, 1 };
ShapeArray origin_{ 0, 0, 0 };
ChannelType channels_type_ = INTENSITY;

template <class type>
auto
CastFill(const type & value) const -> void
{
if (this->GetMemoryType() == MemoryType::BUFFER)
{
Backend::EnqueueFillBuffer(this->GetDevice()->QueuePtr(), this->Get(), true, 0, this->GetMemorySize(), value);
}
else
{
switch (this->GetDataType())
{
case DataType::FLOAT32: {
cl_float4 color = { static_cast<cl_float>(value),
static_cast<cl_float>(value),
static_cast<cl_float>(value),
static_cast<cl_float>(value) };
Backend::EnqueueFillImage(
this->GetDevice()->QueuePtr(), this->Get(), true, this->Origin(), this->Shape(), color);
break;
}
case DataType::INT8:
case DataType::INT16:
case DataType::INT32: {
cl_int4 color = { static_cast<cl_int>(value),
static_cast<cl_int>(value),
static_cast<cl_int>(value),
static_cast<cl_int>(value) };
Backend::EnqueueFillImage(
this->GetDevice()->QueuePtr(), this->Get(), true, this->Origin(), this->Shape(), color);
break;
}
case DataType::UINT8:
case DataType::UINT16:
case DataType::UINT32: {
cl_uint4 color = { static_cast<cl_uint>(value),
static_cast<cl_uint>(value),
static_cast<cl_uint>(value),
static_cast<cl_uint>(value) };
Backend::EnqueueFillImage(
this->GetDevice()->QueuePtr(), this->Get(), true, this->Origin(), this->Shape(), color);
break;
}
default:
throw std::runtime_error("Unsupported data type for fill Image memory type.");
}
}
}
};

} // namespace cle
Expand Down
139 changes: 0 additions & 139 deletions clic/include/core/cleImageOperators.hpp

This file was deleted.

Loading