MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCL-CTS / create_context_and_queue

Function create_context_and_queue

test_conformance/spir/run_services.cpp:106–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 size_t cb, void* userData);
105
106void create_context_and_queue(cl_device_id device, cl_context *out_context, cl_command_queue *out_queue)
107{
108 assert( out_context && "out_context arg must be a valid pointer");
109 assert( out_queue && "out_queue arg must be a valid pointer");
110
111 int error = CL_SUCCESS;
112
113 *out_context = clCreateContext( NULL, 1, &device, notify_callback, NULL, &error );
114 if( NULL == *out_context || error != CL_SUCCESS)
115 {
116 throw Exceptions::TestError("clCreateContext failed\n", error);
117 }
118
119 *out_queue = clCreateCommandQueue( *out_context, device, 0, &error );
120 if( NULL == *out_queue || error )
121 {
122 throw Exceptions::TestError("clCreateCommandQueue failed\n", error);
123 }
124}
125
126/**
127 Loads the kernel text from the given text file

Callers 5

runBuildTestMethod · 0.85
compareResultMethod · 0.85
test_enum_valuesFunction · 0.85
test_kernel_attributesFunction · 0.85
test_binary_typeFunction · 0.85

Calls 1

TestErrorClass · 0.85

Tested by 4

runBuildTestMethod · 0.68
test_enum_valuesFunction · 0.68
test_kernel_attributesFunction · 0.68
test_binary_typeFunction · 0.68