Move ClBuffer/ComputeDevice methods into libattachmentSupport

This commit is contained in:
2025-11-20 00:53:28 -04:00
parent 0cfb0a9c07
commit 2c7e090ef1
4 changed files with 164 additions and 117 deletions
+14
View File
@@ -3,12 +3,18 @@
#include <memory>
#include <vector>
#include <string_view>
#define CL_TARGET_OPENCL_VERSION 120
#include <CL/cl.h>
namespace smo {
namespace compute {
// Helper function to validate OpenCL version
bool validateOpenClVersion(
std::string_view versionStr, std::string_view versionType,
int minMajor, int minMinor);
/**
* @brief OpenCL compute device information
*
@@ -108,6 +114,14 @@ public:
ClBuffer(const ClBuffer&) = delete;
ClBuffer& operator=(const ClBuffer&) = delete;
/**
* @brief Get the cl_mem handle for a specific compute device
* @param device The compute device to find the buffer for
* @return The cl_mem handle for the device, or nullptr if not found
*/
cl_mem getAssociatedBufferHandleForDevice(
const std::shared_ptr<ComputeDevice>& device) const;
void* hostPtr;
size_t size;
cl_mem_flags flags;