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

Fix build errors related with variable defined array length and gl te… #1957

Merged
merged 15 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
d753c07
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
98ef3ea
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
39fb57e
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
adab23d
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
6832508
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
8005698
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
fbb0665
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
2f322d1
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
c4c12cf
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
8dc78bd
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
43b9410
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
6c5b38a
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
ed4272f
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
24ce8fb
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
641c35c
Fix build errors related with variable defined array length and gl te…
jujiang-del Apr 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions test_common/gl/setup_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,26 @@ class X11GLEnvironment : public GLEnvironment
private:
cl_device_id m_devices[64];
cl_uint m_device_count;
bool m_glut_init;

public:
X11GLEnvironment()
{
m_device_count = 0;
m_glut_init = false;
}
virtual int Init( int *argc, char **argv, int use_opencl_32 )
{
// Create a GLUT window to render into
glutInit( argc, argv );
glutInitWindowSize( 512, 512 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "OpenCL <-> OpenGL Test" );
glewInit();
if (!m_glut_init)
{
glutInit(argc, argv);
glutInitWindowSize(512, 512);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow("OpenCL <-> OpenGL Test");
glewInit();
m_glut_init = true;
}
return 0;
}

Expand Down
10 changes: 7 additions & 3 deletions test_conformance/api/test_native_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ int test_native_kernel(cl_device_id device, cl_context context, cl_command_queue
}

clMemWrapper streams[ 2 ];
#if !(defined (_WIN32) && defined (_MSC_VER))
cl_int inBuffer[ n_elems ], outBuffer[ n_elems ];
#if !(defined(_WIN32) && defined(_MSC_VER))
svenvh marked this conversation as resolved.
Show resolved Hide resolved
cl_int *inBuffer = new cl_int[n_elems * sizeof(cl_int)];
cl_int *outBuffer = new cl_int[n_elems * sizeof(cl_int)];
#else
cl_int* inBuffer = (cl_int *)_malloca( n_elems * sizeof(cl_int) );
cl_int* outBuffer = (cl_int *)_malloca( n_elems * sizeof(cl_int) );
Expand Down Expand Up @@ -109,7 +110,10 @@ int test_native_kernel(cl_device_id device, cl_context context, cl_command_queue
return 1;
}
}

#if !(defined(_WIN32) && defined(_MSC_VER))
delete[] inBuffer;
delete[] outBuffer;
#endif
return 0;
}

Expand Down
6 changes: 4 additions & 2 deletions test_conformance/buffers/test_sub_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ int test_sub_buffers_read_write_dual_devices( cl_device_id deviceID, cl_context
test_error( error, "Error obtaining device name" );

#if !(defined(_WIN32) && defined(_MSC_VER))
char device_name[param_size];
char *device_name = new char[param_size];
#else
char* device_name = (char*)_malloca(param_size);
#endif
Expand Down Expand Up @@ -453,7 +453,9 @@ int test_sub_buffers_read_write_dual_devices( cl_device_id deviceID, cl_context
test_error( error, "Unable to get secondary device's address alignment" );

cl_uint addressAlign1 = std::max(addressAlign1Bits, addressAlign2Bits) / 8;

#if !(defined(_WIN32) && defined(_MSC_VER))
delete[] device_name;
#endif
// Finally time to run!
return test_sub_buffers_read_write_core( testingContext, queue1, queue2, maxBuffer1, addressAlign1 );
}
Expand Down
5 changes: 3 additions & 2 deletions test_conformance/gl/test_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ int test_buffer_kernel(cl_context context, cl_command_queue queue,
clMemWrapper streams[3];
size_t dataSize = numElements * 16 * sizeof(cl_long);
#if !(defined(_WIN32) && defined(_MSC_VER))
cl_long inData[numElements * 16], outDataCL[numElements * 16],
outDataGL[numElements * 16];
cl_long *inData = (cl_long *)malloc(dataSize);
cl_long *outDataCL = (cl_long *)malloc(dataSize);
cl_long *outDataGL = (cl_long *)malloc(dataSize);
#else
cl_long *inData = (cl_long *)_malloca(dataSize);
cl_long *outDataCL = (cl_long *)_malloca(dataSize);
Expand Down
14 changes: 10 additions & 4 deletions test_conformance/relationals/test_shuffles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,11 @@ int test_shuffle_dual_kernel(cl_context context, cl_command_queue queue,
typeSize = get_explicit_type_size( vecType );

#if !(defined(_WIN32) && defined (_MSC_VER))
cl_long inData[ inVecSize * numOrders ];
cl_long inSecondData[ inVecSize * numOrders ];
cl_long outData[ outRealVecSize * numOrders ];
cl_long *inData = new cl_long[inVecSize * numOrders * sizeof(cl_long)];
cl_long *inSecondData =
new cl_long[inVecSize * numOrders * sizeof(cl_long)];
cl_long *outData =
new cl_long[outRealVecSize * numOrders * sizeof(cl_long)];
#else
cl_long* inData = (cl_long*)_malloca(inVecSize * numOrders * sizeof(cl_long));
cl_long* inSecondData = (cl_long*)_malloca(inVecSize * numOrders * sizeof(cl_long));
Expand Down Expand Up @@ -726,7 +728,11 @@ int test_shuffle_dual_kernel(cl_context context, cl_command_queue queue,
inSecondDataPtr += inVecSize * typeSize;
outDataPtr += outRealVecSize * typeSize;
}

#if !(defined(_WIN32) && defined(_MSC_VER))
delete[] inData;
delete[] inSecondData;
delete[] outData;
#endif
return ret;
}

Expand Down
Loading