CLTests: Add test for USE_HOST_PTR; fix build warnings

This commit is contained in:
2025-11-08 02:07:43 -04:00
parent bc56c83fad
commit b460c8b2d3
5 changed files with 183 additions and 16 deletions
+4 -1
View File
@@ -1,8 +1,10 @@
#define CL_TARGET_OPENCL_VERSION 300
#include <CL/cl.h>
#include <iostream>
#include <vector>
#include <chrono>
#include <cstring>
#include <cstdlib>
void checkCLError(cl_int err, const char* msg) {
if (err != CL_SUCCESS) {
@@ -70,7 +72,8 @@ int main() {
cl_context ctx = clCreateContext(nullptr, 1, &devices[d], nullptr, nullptr, &err);
checkCLError(err, "create context");
cl_command_queue q = clCreateCommandQueue(ctx, devices[d], 0, &err);
cl_queue_properties queueProps[] = {CL_QUEUE_PROPERTIES, 0, 0};
cl_command_queue q = clCreateCommandQueueWithProperties(ctx, devices[d], queueProps, &err);
checkCLError(err, "create queue");
// --------------------