| 102 | } |
| 103 | |
| 104 | REGISTER_TEST(queue_properties) |
| 105 | { |
| 106 | if (num_elements <= 0) |
| 107 | { |
| 108 | num_elements = 128; |
| 109 | } |
| 110 | int error = 0; |
| 111 | |
| 112 | clProgramWrapper program; |
| 113 | clKernelWrapper kernel; |
| 114 | cl_command_queue_properties device_props = 0; |
| 115 | cl_command_queue_properties queue_prop_def[] = { CL_QUEUE_PROPERTIES, 0, |
| 116 | 0 }; |
| 117 | |
| 118 | // Query extension |
| 119 | if (!is_extension_available(device, "cl_khr_create_command_queue")) |
| 120 | { |
| 121 | log_info("extension cl_khr_create_command_queue is not supported.\n"); |
| 122 | return 0; |
| 123 | } |
| 124 | |
| 125 | error = create_single_kernel_helper(context, &program, &kernel, 1, queue_test_kernel, "vec_cpy"); |
| 126 | test_error(error, "create_single_kernel_helper failed"); |
| 127 | |
| 128 | log_info("Queue property NULL. Testing ... \n"); |
| 129 | error = enqueue_kernel(context, NULL, device, kernel, (size_t)num_elements); |
| 130 | test_error(error, "enqueue_kernel failed"); |
| 131 | |
| 132 | error = clGetDeviceInfo(device, CL_DEVICE_QUEUE_PROPERTIES, |
| 133 | sizeof(device_props), &device_props, NULL); |
| 134 | test_error(error, "clGetDeviceInfo for CL_DEVICE_QUEUE_PROPERTIES failed"); |
| 135 | |
| 136 | if (device_props & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) |
| 137 | { |
| 138 | log_info("Queue property CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE supported. Testing ... \n"); |
| 139 | queue_prop_def[1] = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; |
| 140 | error = enqueue_kernel(context, queue_prop_def, device, kernel, |
| 141 | (size_t)num_elements); |
| 142 | test_error(error, "enqueue_kernel failed"); |
| 143 | } else |
| 144 | { |
| 145 | log_info("Queue property CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE not supported \n"); |
| 146 | } |
| 147 | |
| 148 | if (device_props & CL_QUEUE_PROFILING_ENABLE) |
| 149 | { |
| 150 | log_info("Queue property CL_QUEUE_PROFILING_ENABLE supported. Testing ... \n"); |
| 151 | queue_prop_def[1] = CL_QUEUE_PROFILING_ENABLE; |
| 152 | error = enqueue_kernel(context, queue_prop_def, device, kernel, |
| 153 | (size_t)num_elements); |
| 154 | test_error(error, "enqueue_kernel failed"); |
| 155 | } else |
| 156 | { |
| 157 | log_info("Queue property CL_QUEUE_PROFILING_ENABLE not supported \n"); |
| 158 | } |
| 159 | |
| 160 | if (device_props & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE && device_props & CL_QUEUE_PROFILING_ENABLE) |
| 161 | { |
nothing calls this directly
no test coverage detected