Skip to content

Commit

Permalink
run clang-format on touched files
Browse files Browse the repository at this point in the history
  • Loading branch information
karolherbst committed Feb 2, 2024
1 parent f6f599b commit c4c9ea9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 35 deletions.
5 changes: 2 additions & 3 deletions test_conformance/gl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ int main(int argc, const char *argv[])
// At least one device supports CL-GL interop, so init the test.
if (glEnv->Init(&argc, (char **)argv, CL_FALSE))
{
log_error(
"Failed to initialize the GL environment for this test.\n");
log_error("Failed to initialize the GL environment for this test.\n");
return -1;
}

Expand Down Expand Up @@ -333,7 +332,7 @@ int main(int argc, const char *argv[])

// OpenGL 3.2 tests.
// ////////////////////////////////////////////////////////
if ((argc == 1) || first_32_testname)
if ((argc == 1) || first_32_testname)
{
// Create a context to use and then grab a device (or devices) from it
sCurrentContext = glEnv->CreateCLContext();
Expand Down
72 changes: 40 additions & 32 deletions test_conformance/gles/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ int main(int argc, const char *argv[])
}

// At least one device supports CL-GL interop, so init the test.
if( glEnv->Init( &argc, (char **)argv, CL_FALSE ) ) {
log_error("Failed to initialize the GL environment for this test.\n");
error = -1;
goto cleanup;
if (glEnv->Init(&argc, (char **)argv, CL_FALSE))
{
log_error("Failed to initialize the GL environment for this test.\n");
error = -1;
goto cleanup;
}

// OpenGL tests for non-3.2 ////////////////////////////////////////////////////////
Expand Down Expand Up @@ -282,38 +283,45 @@ int main(int argc, const char *argv[])
}

// OpenGL 3.2 tests. ////////////////////////////////////////////////////////
if ((argc==1) || first_32_testname) {
// Create a context to use and then grab a device (or devices) from it
sCurrentContext = glEnv->CreateCLContext();
if( sCurrentContext == NULL ) {
log_error( "ERROR: Unable to obtain CL context from GL\n" );
error = -1;
goto cleanup;
}
if ((argc == 1) || first_32_testname)
{
// Create a context to use and then grab a device (or devices) from it
sCurrentContext = glEnv->CreateCLContext();
if (sCurrentContext == NULL)
{
log_error("ERROR: Unable to obtain CL context from GL\n");
error = -1;
goto cleanup;
}

size_t numDevices = 0;
cl_device_id deviceIDs[ 16 ];
size_t numDevices = 0;
cl_device_id deviceIDs[16];

error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL, &numDevices);
if( error != CL_SUCCESS ) {
print_error( error, "Unable to get device count from context" );
error = -1;
goto cleanup;
}
numDevices /= sizeof(cl_device_id);
error = clGetContextInfo(sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL,
&numDevices);
if (error != CL_SUCCESS)
{
print_error(error, "Unable to get device count from context");
error = -1;
goto cleanup;
}
numDevices /= sizeof(cl_device_id);

if (numDevices < 1) {
log_error("No devices found.\n");
error = -1;
goto cleanup;
}
if (numDevices < 1)
{
log_error("No devices found.\n");
error = -1;
goto cleanup;
}

error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, sizeof( deviceIDs ), deviceIDs, NULL);
if( error != CL_SUCCESS ) {
print_error( error, "Unable to get device list from context" );
error = -1;
goto cleanup;
}
error = clGetContextInfo(sCurrentContext, CL_CONTEXT_DEVICES,
sizeof(deviceIDs), deviceIDs, NULL);
if (error != CL_SUCCESS)
{
print_error(error, "Unable to get device list from context");
error = -1;
goto cleanup;
}

#ifdef GLES3
int argc_ = (first_32_testname) ? 1 + (argc - first_32_testname) : argc;
Expand Down

0 comments on commit c4c9ea9

Please sign in to comment.