From 419c51256ea82e4e83dfa70c96b0e46f1909b3b8 Mon Sep 17 00:00:00 2001 From: JordanHanotiaux <103147288+JordanHanotiaux@users.noreply.github.com> Date: Mon, 19 May 2025 11:02:16 +0200 Subject: [PATCH] Update main.cpp --- main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 67c1360..6683979 100644 --- a/main.cpp +++ b/main.cpp @@ -82,7 +82,7 @@ std::vector<float> fill_random(int rows, int cols) { int main(int argc, char** argv) { - // 1. --- OpenCL Setup --- + std::cout << "--- OpenCL Setup ---" << std::endl; std::vector<cl::Platform> platforms; cl::Platform::get(&platforms); if (platforms.empty()) { @@ -90,10 +90,12 @@ int main(int argc, char** argv) { return 1; } cl::Platform platform = platforms.front(); + std::cout << "Using Platform: " << platform.getInfo<CL_PLATFORM_NAME>() << std::endl; std::vector<cl::Device> devices; platform.getDevices(CL_DEVICE_TYPE_GPU, &devices); if (devices.empty()) { + std::cout << "No GPU found, trying CPU..." << std::endl; platform.getDevices(CL_DEVICE_TYPE_CPU, &devices); if (devices.empty()) { std::cerr << "No OpenCL devices found." << std::endl; @@ -101,10 +103,11 @@ int main(int argc, char** argv) { } } cl::Device device = devices.front(); + std::cout << "Using Device: " << device.getInfo<CL_DEVICE_NAME>() << std::endl; cl::Context context(device); cl_int err; - cl_command_queue cq = clCreateCommandQueue(context, device, CL_QUEUE_PROFILING_ENABLE, &err); + cl_command_queue cq = clCreateCommandQueue(context(device), device, CL_QUEUE_PROFILING_ENABLE, &err); if (err != CL_SUCCESS) { std::cerr << "Failed to create command queue: " << err << std::endl; exit(1); -- GitLab