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

add tests for cl_ext_buffer_device_address #2192

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

franz
Copy link
Contributor

@franz franz commented Dec 14, 2024

No description provided.

Copy link
Contributor

@bashbaug bashbaug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use the new test registration framework for these tests? It should reduce a bit of the test boilerplate, and then we won't need to switch them over later.

#2151

@franz
Copy link
Contributor Author

franz commented Dec 19, 2024

@bashbaug added, based on the device_timer test.

@karolherbst
Copy link
Contributor

Not sure if you got to it yet, but I've fixed the test so it compiles and conforms to the recent version, might need some cleanup and reformatting and all that:

@@ -59,8 +59,10 @@ public:
     bool Skip()
     {
         cl_int error = 0;
-        clMemWrapper TempBuffer = clCreateBuffer(
-            context, (cl_mem_flags)(CL_MEM_READ_WRITE | address_type),
+
+        cl_mem_properties buf_props[] = { address_type, CL_TRUE, 0 };
+        clMemWrapper TempBuffer = clCreateBufferWithProperties(
+            context, buf_props, CL_MEM_READ_WRITE,
             (size_t)BUF_SIZE * sizeof(cl_int), nullptr, &error);
         return (error != CL_SUCCESS);
     }
@@ -108,7 +110,7 @@ public:
 
         // Test a buffer which doesn't have any hostptr associated with it.
         dev_addr_no_host_buffer =
-            clCreateBuffer(context, CL_MEM_READ_WRITE | address_type,
+            clCreateBufferWithProperties(context, buf_props, CL_MEM_READ_WRITE,
                            sizeof(cl_int) * BUF_SIZE, nullptr, &error);
         test_error(error, "clCreateBuffer with device address 2 failed\n");
 
@@ -189,7 +191,7 @@ private:
             sizeof(cl_int) * BUF_SIZE, svm_buffer(), &error);
         test_error(error, "clCreateBuffer with device address 1 failed\n");
 
-        cl_mem_device_address_EXT Addr = 0;
+        cl_mem_device_address_ext Addr = 0;
         error = clGetMemObjectInfo(buffer, CL_MEM_DEVICE_ADDRESS_EXT,
                                    sizeof(Addr), &Addr, NULL);
         test_error(error,
@@ -376,10 +378,11 @@ private:
             check_device_address_from_api(dev_addr_buffer, DeviceAddrFromAPI);
         test_error_fail(error, "dev_addr_buffer does not have device address")
 
+        cl_mem_device_address_ext DeviceAddrFromAPIP2 = (cl_mem_device_address_ext)(((cl_uint *)DeviceAddrFromAPI) + 2);
             error = clSetKernelArgDevicePointer(
                 ptr_arith_kernel, 0,
-                (cl_mem_device_address_ext)(((cl_uint *)DeviceAddrFromAPI)
-                                            + 2));
+                &DeviceAddrFromAPIP2);
+
         test_error_fail(error, "clSetKernelArgDevicePointer failed\n");
         error = clSetKernelArg(ptr_arith_kernel, 1, sizeof(cl_mem),
                                &buffer_out_int);

@franz
Copy link
Contributor Author

franz commented Jan 20, 2025

@karolherbst thanks, added

@karolherbst
Copy link
Contributor

I forgot to bump the version

diff --git a/test_conformance/extensions/cl_ext_buffer_device_address/main.cpp b/test_conformance/extensions/cl_ext_buffer_device_address/main.cpp
index 1ce30008..d8475647 100644
--- a/test_conformance/extensions/cl_ext_buffer_device_address/main.cpp
+++ b/test_conformance/extensions/cl_ext_buffer_device_address/main.cpp
@@ -38,7 +38,7 @@ test_status InitCL(cl_device_id device)
 
     cl_version ext_version =
         get_extension_version(device, "cl_ext_buffer_device_address");
-    if (ext_version != CL_MAKE_VERSION(0, 9, 1))
+    if (ext_version != CL_MAKE_VERSION(1, 0, 0))
     {
         log_info("The test is written against cl_ext_buffer_device_address "
                  "extension version 0.9.1, device supports version: %u.%u.%u\n",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants