Skip to content

Commit

Permalink
fix cpu provider
Browse files Browse the repository at this point in the history
  • Loading branch information
inakleinbottle committed Oct 20, 2023
1 parent 57b7076 commit 967e0eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions device/src/cpu/cpu_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,16 @@ CPUDeviceHandle::CPUDeviceHandle() : p_ocl_handle(nullptr)
}
CPUDeviceHandle::~CPUDeviceHandle() = default;



CPUDevice CPUDeviceHandle::get()
{
static boost::intrusive_ptr<CPUDeviceHandle> device(new CPUDeviceHandle);
return device;
}



DeviceInfo CPUDeviceHandle::info() const noexcept
{
return {DeviceType::CPU, 0};
Expand Down Expand Up @@ -254,3 +258,7 @@ bool CPUDeviceHandle::supports_type(const TypeInfo& info) const noexcept
return true;
}
OCLDevice CPUDeviceHandle::ocl_device() const noexcept { return p_ocl_handle; }
DeviceCategory CPUDeviceHandle::category() const noexcept
{
return DeviceCategory::CPU;
}
2 changes: 1 addition & 1 deletion device/src/cpu/cpu_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CPUDeviceHandle : public DeviceHandle

static CPUDevice get();


DeviceCategory category() const noexcept override;
DeviceInfo info() const noexcept override;
Buffer raw_alloc(dimn_t count, dimn_t alignment) const override;
void raw_free(void* pointer, dimn_t size) const override;
Expand Down
2 changes: 1 addition & 1 deletion device/src/cpu/cpu_device_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using namespace rpy::devices;

bool CPUDeviceProvider::supports(DeviceCategory category) const noexcept
{
return true;
return category == DeviceCategory::CPU;
}
int CPUDeviceProvider::priority(const DeviceSpecification& spec) const noexcept
{
Expand Down

0 comments on commit 967e0eb

Please sign in to comment.