mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-22 23:29:02 +00:00
Remove "C" linkages (#781)
* Remove extern C linkages * Update crc32 to cpp and remove extern C linkage
This commit is contained in:
@@ -19,8 +19,6 @@
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
const char *sample_single_param_kernel[] = {
|
||||
"__kernel void sample_test(__global int *src)\n"
|
||||
"{\n"
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
|
||||
#include "harness/conversions.h"
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
int test_create_context_from_type(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements)
|
||||
{
|
||||
int error;
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
//
|
||||
#include "testBase.h"
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed;}
|
||||
|
||||
// This test is designed to stress changing kernel arguments between execute calls (that are asynchronous and thus
|
||||
// potentially overlapping) to make sure each kernel gets the right arguments
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@ const char *multi_arg_kernel_source_pattern =
|
||||
" dst3[tid] = src3[tid];\n"
|
||||
"}\n";
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
#define MAX_ERROR_TOLERANCE 0.0005f
|
||||
|
||||
int test_multi_arg_set(cl_device_id device, cl_context context, cl_command_queue queue,
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/conversions.h"
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
const char *sample_single_test_kernel[] = {
|
||||
"__kernel void sample_test(__global float *src, __global int *dst)\n"
|
||||
"{\n"
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/testHarness.h"
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
|
||||
#define TEST_MEM_OBJECT_PARAM( mem, paramName, val, expected, name, type, cast ) \
|
||||
error = clGetMemObjectInfo( mem, paramName, sizeof( val ), &val, &size ); \
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
|
||||
#include "harness/conversions.h"
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
static void CL_CALLBACK test_native_kernel_fn( void *userData )
|
||||
{
|
||||
struct arg_struct {
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
#define LONG_TEST_VALUE 515154531254381446LL
|
||||
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
const char *atomic_global_pattern[] = {
|
||||
"__kernel void test_atomic_fn(volatile __global %s *destMemory, __global %s *oldValues)\n"
|
||||
"{\n"
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
#include "testBase.h"
|
||||
#include "harness/conversions.h"
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
const char * atomic_index_source =
|
||||
"#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable\n"
|
||||
"// Counter keeps track of which index in counts we are using.\n"
|
||||
|
||||
@@ -66,8 +66,6 @@ extern bool gDebug; // print OpenCL kernel code
|
||||
extern int gInternalIterations; // internal test iterations for atomic operation, sufficient to verify atomicity
|
||||
extern int gMaxDeviceThreads; // maximum number of threads executed on OCL device
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
extern const char *get_memory_order_type_name(TExplicitMemoryOrderType orderType);
|
||||
extern const char *get_memory_scope_type_name(TExplicitMemoryScopeType scopeType);
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ static const char *smoothstep4_kernel_code =
|
||||
|
||||
#define MAX_ERR (1e-5f)
|
||||
|
||||
extern "C" float
|
||||
verify_smoothstep(float *edge0, float *edge1, float *x, float *outptr, int n, int veclen)
|
||||
float verify_smoothstep(float *edge0, float *edge1, float *x, float *outptr,
|
||||
int n, int veclen)
|
||||
{
|
||||
float r, t, delta, max_err = 0.0f;
|
||||
int i, j;
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#endif
|
||||
#include "harness/conversions.h"
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
#define MAX_LINE_SIZE_IN_PROGRAM 1024
|
||||
#define MAX_LOG_SIZE_IN_PROGRAM 2048
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
#include "testBase.h"
|
||||
#include "harness/os_helpers.h"
|
||||
|
||||
extern cl_uint gRandomSeed;
|
||||
|
||||
const char *define_kernel_code[] = {
|
||||
" #define VALUE\n"
|
||||
"__kernel void define_test(__global int *src, __global int *dstA, __global int *dstB)\n"
|
||||
|
||||
@@ -104,17 +104,9 @@
|
||||
}
|
||||
|
||||
#else /* not __APPLE__ */
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void PreventSleep( void ) {}
|
||||
void ResumeSleep( void ) {}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -16,17 +16,9 @@
|
||||
#ifndef SLEEP_H
|
||||
#define SLEEP_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void PreventSleep( void );
|
||||
void ResumeSleep( void );
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif /* SLEEP_H */
|
||||
|
||||
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
//
|
||||
#include "harness/testHarness.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int test_device_info(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_device_queue(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_execute_block(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
@@ -33,8 +29,4 @@ extern int test_host_queue_order(cl_device_id device, cl_context context, cl_com
|
||||
|
||||
extern int test_execution_stress(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -108,10 +108,6 @@
|
||||
|
||||
#include <GL/glew.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef int32_t EGLint;
|
||||
|
||||
typedef unsigned int EGLBoolean;
|
||||
@@ -2611,8 +2607,4 @@ GLEWAPI GLboolean GLEWAPIENTRY eglewIsSupported (const char *name);
|
||||
|
||||
GLEWAPI GLboolean GLEWAPIENTRY eglewGetExtension (const char *name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __eglew_h__ */
|
||||
|
||||
@@ -266,10 +266,6 @@ typedef _W64 int ptrdiff_t;
|
||||
#define GLEW_VAR_EXPORT GLEWAPI
|
||||
#define GLEW_FUN_EXPORT GLEWAPI
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ----------------------------- GL_VERSION_1_1 ---------------------------- */
|
||||
|
||||
#ifndef GL_VERSION_1_1
|
||||
@@ -23661,10 +23657,6 @@ GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name);
|
||||
GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error);
|
||||
GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef GLEW_APIENTRY_DEFINED
|
||||
#undef GLEW_APIENTRY_DEFINED
|
||||
#undef APIENTRY
|
||||
|
||||
@@ -100,10 +100,6 @@
|
||||
#include <X11/Xmd.h>
|
||||
#include <GL/glew.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ---------------------------- GLX_VERSION_1_0 --------------------------- */
|
||||
|
||||
#ifndef GLX_VERSION_1_0
|
||||
@@ -1768,8 +1764,4 @@ GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name);
|
||||
|
||||
GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __glxew_h__ */
|
||||
|
||||
@@ -85,10 +85,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* -------------------------- WGL_3DFX_multisample ------------------------- */
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
@@ -1438,10 +1434,6 @@ GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name);
|
||||
|
||||
GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef GLEWAPI
|
||||
|
||||
#endif /* __wglew_h__ */
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include <CL/cl_gl.h>
|
||||
#endif
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; };
|
||||
|
||||
static const char *bufferKernelPattern =
|
||||
"__kernel void sample_test( __global %s%s *source, __global %s%s *clDest, __global %s%s *glDest )\n"
|
||||
"{\n"
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; }
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark _2D read tests
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; };
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark _3D read test
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; }
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark _2D depth read tests
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
#include <CL/cl_gl.h>
|
||||
#endif
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; };
|
||||
|
||||
extern int supportsHalf(cl_context context, bool* supports_half);
|
||||
|
||||
static int test_image_info( cl_context context, cl_command_queue queue,
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
#include <CL/cl_gl.h>
|
||||
#endif
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; };
|
||||
|
||||
extern int supportsHalf(cl_context context, bool* supports_half);
|
||||
extern int supportsMsaa(cl_context context, bool* supports_msaa);
|
||||
extern int supportsDepth(cl_context context, bool* supports_depth);
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#include <CL/cl_gl.h>
|
||||
#endif
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; };
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Write test kernels
|
||||
|
||||
|
||||
@@ -52,8 +52,6 @@ gluCheckExtension(const GLubyte *extension, const GLubyte *extensions)
|
||||
#endif
|
||||
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; };
|
||||
|
||||
// This is defined in the write common code:
|
||||
extern int test_cl_image_write( cl_context context, cl_command_queue queue,
|
||||
GLenum target, cl_mem clImage, size_t width, size_t height, size_t depth,
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include <CL/cl_gl.h>
|
||||
#endif
|
||||
|
||||
extern "C" {extern cl_uint gRandomSeed;};
|
||||
|
||||
static int test_renderbuffer_object_info( cl_context context, cl_command_queue queue,
|
||||
GLsizei width, GLsizei height, GLenum attachment,
|
||||
GLenum format, GLenum internalFormat,
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#include <CL/cl_gl.h>
|
||||
#endif
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; };
|
||||
|
||||
static const char *bufferKernelPattern =
|
||||
"__kernel void sample_test( __global %s%s *source, __global %s%s *clDest, __global %s%s *glDest )\n"
|
||||
"{\n"
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
#include "gl_headers.h"
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; }
|
||||
|
||||
static const char *imageReadKernelPattern =
|
||||
"#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n" /* added support for half floats */
|
||||
"__kernel void sample_test( read_only image2d_t source, sampler_t sampler, __global %s4 *results )\n"
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
#include "gl_headers.h"
|
||||
|
||||
extern "C" {extern cl_uint gRandomSeed;};
|
||||
|
||||
static int test_image_read( cl_context context, cl_command_queue queue, GLenum glTarget, GLuint glTexture,
|
||||
size_t imageWidth, size_t imageHeight, cl_image_format *outFormat,
|
||||
ExplicitType *outType, void **outResultBuffer )
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
#include "gl_headers.h"
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; };
|
||||
|
||||
static const char *imageReadKernelPattern =
|
||||
"__kernel void sample_test( read_only image3d_t source, sampler_t sampler, __global %s4 *results )\n"
|
||||
"{\n"
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
#include "gl_headers.h"
|
||||
#include "testBase.h"
|
||||
|
||||
extern "C" {extern cl_uint gRandomSeed;};
|
||||
|
||||
static int test_image_read( cl_context context, cl_command_queue queue, GLenum glTarget, GLuint glTexture,
|
||||
size_t imageWidth, size_t imageHeight, size_t imageDepth, cl_image_format *outFormat, ExplicitType *outType, void **outResultBuffer )
|
||||
{
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include "gl_headers.h"
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; };
|
||||
|
||||
extern int test_cl_image_write( cl_context context, cl_command_queue queue, cl_mem clImage,
|
||||
size_t imageWidth, size_t imageHeight, cl_image_format *outFormat,
|
||||
ExplicitType *outType, void **outSourceBuffer, MTdata d );
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
#include "gl_headers.h"
|
||||
#include "testBase.h"
|
||||
|
||||
extern "C" {extern cl_uint gRandomSeed;};
|
||||
|
||||
static int test_renderbuffer_object_info( cl_context context, cl_command_queue queue,
|
||||
GLsizei width, GLsizei height, GLenum attachment,
|
||||
GLenum rbFormat, GLenum rbType,
|
||||
|
||||
@@ -59,9 +59,6 @@
|
||||
#define HALF_ENTRY( _name, _ulp, _embedded_ulp, _rmode, _type ) { "half_" STRINGIFY(_name), "half_" STRINGIFY(_name), {(void*)reference_##_name}, {NULL}, {NULL}, _ulp, _ulp, _embedded_ulp, INFINITY, _rmode, RELAXED_OFF, _type }
|
||||
#define OPERATOR_ENTRY(_name, _operator, _ulp, _embedded_ulp, _rmode, _type) { STRINGIFY(_name), _operator, {(void*)reference_##_name}, {(void*)reference_##_name##l}, {NULL}, _ulp, _ulp, _embedded_ulp, INFINITY, _rmode, RELAXED_OFF, _type }
|
||||
|
||||
#if defined( __cplusplus )
|
||||
extern "C" {
|
||||
#endif
|
||||
extern const vtbl _unary; // float foo( float )
|
||||
extern const vtbl _unary_u; // float foo( uint ), double foo( ulong )
|
||||
extern const vtbl _i_unary; // int foo( float )
|
||||
@@ -76,9 +73,6 @@ extern const vtbl _unary_two_results; // float foo( float, float * )
|
||||
extern const vtbl _unary_two_results_i; // float foo( float, int * )
|
||||
extern const vtbl _binary_two_results_i; // float foo( float, float, int * )
|
||||
extern const vtbl _mad_tbl; // float mad( float, float, float )
|
||||
#if defined( __cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define unaryF &_unary
|
||||
#define i_unaryF &_i_unary
|
||||
|
||||
@@ -30,10 +30,6 @@
|
||||
|
||||
#include "harness/mt19937.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef union fptr
|
||||
{
|
||||
void *p;
|
||||
@@ -97,10 +93,6 @@ extern const Func functionList[];
|
||||
|
||||
extern const size_t functionListCount;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -90,16 +90,10 @@ extern cl_device_fp_config gDoubleCapabilities;
|
||||
#define scalbnl( _a, _i ) ldexpl( _a, _i )
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
float Abs_Error( float test, double reference );
|
||||
float Ulp_Error( float test, double reference );
|
||||
//float Ulp_Error_Half( float test, double reference );
|
||||
float Bruteforce_Ulp_Error_Double( double test, long double reference );
|
||||
#ifdef __cplusplus
|
||||
} //extern "C"
|
||||
#endif
|
||||
|
||||
uint64_t GetTime( void );
|
||||
double SubtractTime( uint64_t endTime, uint64_t startTime );
|
||||
@@ -230,11 +224,7 @@ static inline void Force64BitFPUPrecision(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#else
|
||||
extern
|
||||
#endif
|
||||
void memset_pattern4(void *dest, const void *src_pattern, size_t bytes );
|
||||
|
||||
typedef union
|
||||
|
||||
@@ -28,15 +28,13 @@ int TestFunc_Double_Double_Double_common(const Func *f, MTdata, int isNextafter)
|
||||
const float twoToMinus126 = MAKE_HEX_FLOAT(0x1p-126f, 1, -126);
|
||||
const double twoToMinus1022 = MAKE_HEX_DOUBLE(0x1p-1022, 1, -1022);
|
||||
|
||||
#if defined( __cplusplus )
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _binary = { "binary", TestFunc_Float_Float_Float, TestFunc_Double_Double_Double };
|
||||
extern const vtbl _binary = { "binary", TestFunc_Float_Float_Float,
|
||||
TestFunc_Double_Double_Double };
|
||||
|
||||
#if defined( __cplusplus )
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _binary_nextafter = { "binary_nextafter", TestFunc_Float_Float_Float_nextafter, TestFunc_Double_Double_Double_nextafter };
|
||||
extern const vtbl _binary_nextafter = {
|
||||
"binary_nextafter", TestFunc_Float_Float_Float_nextafter,
|
||||
TestFunc_Double_Double_Double_nextafter
|
||||
};
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
|
||||
|
||||
@@ -21,11 +21,9 @@
|
||||
int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata);
|
||||
int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
|
||||
const vtbl _binary_operator = { "binaryOperator", TestFunc_Float_Float_Float_Operator, TestFunc_Double_Double_Double_Operator };
|
||||
extern const vtbl _binary_operator = { "binaryOperator",
|
||||
TestFunc_Float_Float_Float_Operator,
|
||||
TestFunc_Double_Double_Double_Operator };
|
||||
|
||||
static int BuildKernel( const char *name, const char *operator_symbol, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
static int BuildKernelDouble( const char *name, const char *operator_symbol, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -22,10 +22,8 @@
|
||||
int TestFunc_Float_Float_Int(const Func *f, MTdata);
|
||||
int TestFunc_Double_Double_Int(const Func *f, MTdata);
|
||||
|
||||
#if defined( __cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _binary_i = { "binary_i", TestFunc_Float_Float_Int, TestFunc_Double_Double_Int };
|
||||
extern const vtbl _binary_i = { "binary_i", TestFunc_Float_Float_Int,
|
||||
TestFunc_Double_Double_Int };
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -24,10 +24,9 @@
|
||||
int TestFunc_FloatI_Float_Float(const Func *f, MTdata);
|
||||
int TestFunc_DoubleI_Double_Double(const Func *f, MTdata);
|
||||
|
||||
#if defined( __cplusplus )
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _binary_two_results_i = { "binary_two_results_i", TestFunc_FloatI_Float_Float, TestFunc_DoubleI_Double_Double };
|
||||
extern const vtbl _binary_two_results_i = { "binary_two_results_i",
|
||||
TestFunc_FloatI_Float_Float,
|
||||
TestFunc_DoubleI_Double_Double };
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -21,10 +21,8 @@
|
||||
int TestFunc_Int_Float(const Func *f, MTdata);
|
||||
int TestFunc_Int_Double(const Func *f, MTdata);
|
||||
|
||||
#if defined( __cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _i_unary = { "i_unary", TestFunc_Int_Float, TestFunc_Int_Double };
|
||||
extern const vtbl _i_unary = { "i_unary", TestFunc_Int_Float,
|
||||
TestFunc_Int_Double };
|
||||
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -21,10 +21,8 @@
|
||||
int TestMacro_Int_Float_Float(const Func *f, MTdata);
|
||||
int TestMacro_Int_Double_Double(const Func *f, MTdata);
|
||||
|
||||
#if defined( __cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _macro_binary = { "macro_binary", TestMacro_Int_Float_Float, TestMacro_Int_Double_Double };
|
||||
extern const vtbl _macro_binary = { "macro_binary", TestMacro_Int_Float_Float,
|
||||
TestMacro_Int_Double_Double };
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -21,10 +21,8 @@
|
||||
int TestMacro_Int_Float(const Func *f, MTdata);
|
||||
int TestMacro_Int_Double(const Func *f, MTdata);
|
||||
|
||||
#if defined( __cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _macro_unary = { "macro_unary", TestMacro_Int_Float, TestMacro_Int_Double };
|
||||
extern const vtbl _macro_unary = { "macro_unary", TestMacro_Int_Float,
|
||||
TestMacro_Int_Double };
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -21,10 +21,7 @@
|
||||
int TestFunc_mad(const Func *f, MTdata);
|
||||
int TestFunc_mad_Double(const Func *f, MTdata);
|
||||
|
||||
#if defined( __cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _mad_tbl = { "ternary", TestFunc_mad, TestFunc_mad_Double };
|
||||
extern const vtbl _mad_tbl = { "ternary", TestFunc_mad, TestFunc_mad_Double };
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -24,10 +24,8 @@
|
||||
int TestFunc_Float_Float_Float_Float(const Func *f, MTdata);
|
||||
int TestFunc_Double_Double_Double_Double(const Func *f, MTdata);
|
||||
|
||||
#if defined( __cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _ternary = { "ternary", TestFunc_Float_Float_Float_Float, TestFunc_Double_Double_Double_Double };
|
||||
extern const vtbl _ternary = { "ternary", TestFunc_Float_Float_Float_Float,
|
||||
TestFunc_Double_Double_Double_Double };
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -25,10 +25,8 @@
|
||||
int TestFunc_Float_Float(const Func *f, MTdata);
|
||||
int TestFunc_Double_Double(const Func *f, MTdata);
|
||||
|
||||
#if defined( __cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _unary = { "unary", TestFunc_Float_Float, TestFunc_Double_Double };
|
||||
extern const vtbl _unary = { "unary", TestFunc_Float_Float,
|
||||
TestFunc_Double_Double };
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
static int BuildKernelDouble( const char *name, int vectorSize, cl_uint kernel_count, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -21,10 +21,9 @@
|
||||
int TestFunc_Float2_Float(const Func *f, MTdata);
|
||||
int TestFunc_Double2_Double(const Func *f, MTdata);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _unary_two_results = { "unary_two_results", TestFunc_Float2_Float, TestFunc_Double2_Double };
|
||||
extern const vtbl _unary_two_results = { "unary_two_results",
|
||||
TestFunc_Float2_Float,
|
||||
TestFunc_Double2_Double };
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -22,10 +22,9 @@
|
||||
int TestFunc_FloatI_Float(const Func *f, MTdata);
|
||||
int TestFunc_DoubleI_Double(const Func *f, MTdata);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _unary_two_results_i = { "unary_two_results_i", TestFunc_FloatI_Float, TestFunc_DoubleI_Double };
|
||||
extern const vtbl _unary_two_results_i = { "unary_two_results_i",
|
||||
TestFunc_FloatI_Float,
|
||||
TestFunc_DoubleI_Double };
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
static int BuildKernelDouble( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -21,10 +21,8 @@
|
||||
int TestFunc_Float_UInt(const Func *f, MTdata);
|
||||
int TestFunc_Double_ULong(const Func *f, MTdata);
|
||||
|
||||
#if defined( __cplusplus)
|
||||
extern "C"
|
||||
#endif
|
||||
const vtbl _unary_u = { "unary_u", TestFunc_Float_UInt, TestFunc_Double_ULong };
|
||||
extern const vtbl _unary_u = { "unary_u", TestFunc_Float_UInt,
|
||||
TestFunc_Double_ULong };
|
||||
|
||||
|
||||
static int BuildKernel( const char *name, int vectorSize, cl_kernel *k, cl_program *p );
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#include "harness/conversions.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed; };
|
||||
|
||||
#define TEST_SIZE 512
|
||||
|
||||
const char *equivTestKernelPattern_double =
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#include "harness/conversions.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed;};
|
||||
|
||||
#define TEST_SIZE 512
|
||||
|
||||
const char *equivTestKernelPattern_float =
|
||||
@@ -63,7 +61,7 @@ const char *equivTestKernelPatternLessGreater_float3 =
|
||||
"}\n";
|
||||
|
||||
typedef bool (*equivVerifyFn)( float inDataA, float inDataB );
|
||||
extern "C" { extern int gInfNanSupport; };
|
||||
extern int gInfNanSupport;
|
||||
|
||||
int IsFloatInfinity(float x)
|
||||
{
|
||||
|
||||
@@ -38,8 +38,6 @@ const char *anyAllTestKernelPatternVload =
|
||||
|
||||
#define TEST_SIZE 512
|
||||
|
||||
extern "C" {extern cl_uint gRandomSeed;};
|
||||
|
||||
typedef int (*anyAllVerifyFn)( ExplicitType vecType, unsigned int vecSize, void *inData );
|
||||
|
||||
int test_any_all_kernel(cl_context context, cl_command_queue queue,
|
||||
|
||||
@@ -36,8 +36,6 @@ enum ShuffleMode
|
||||
kBuiltInDualInputFnMode
|
||||
};
|
||||
|
||||
extern "C" { extern cl_uint gRandomSeed;};
|
||||
|
||||
static const char *shuffleKernelPattern[3] = {
|
||||
"__kernel void sample_test( __global %s%s *source, __global %s%s *dest )\n"
|
||||
"{\n"
|
||||
|
||||
@@ -93,38 +93,6 @@ void DataGenerator::setArgGenerator(const KernelArgInfo& argInfo,
|
||||
m_argGenerators[argInfo.getTypeName()] = pGen;
|
||||
}
|
||||
|
||||
float get_random_float(float low, float high, MTdata d)
|
||||
{
|
||||
float t = (float)((double)genrand_int32(d) / (double)0xFFFFFFFF);
|
||||
return (1.0f - t) * low + t * high;
|
||||
}
|
||||
|
||||
double get_random_double(double low, double high, MTdata d)
|
||||
{
|
||||
cl_ulong u = (cl_ulong) genrand_int32(d) | ((cl_ulong) genrand_int32(d) << 32 );
|
||||
double t = (double) u * MAKE_HEX_DOUBLE( 0x1.0p-64, 0x1, -64);
|
||||
return (1.0f - t) * low + t * high;
|
||||
}
|
||||
|
||||
size_t get_random_size_t(size_t low, size_t high, MTdata d)
|
||||
{
|
||||
enum { N = sizeof(size_t)/sizeof(int) };
|
||||
|
||||
union {
|
||||
int word[N];
|
||||
size_t size;
|
||||
} u;
|
||||
|
||||
for (unsigned i=0; i != N; ++i) {
|
||||
u.word[i] = genrand_int32(d);
|
||||
}
|
||||
|
||||
assert(low <= high && "Invalid random number range specified");
|
||||
size_t range = high - low;
|
||||
|
||||
return (range) ? low + ((u.size - low) % range) : low;
|
||||
}
|
||||
|
||||
size_t get_random_int32(int low, int high, MTdata d)
|
||||
{
|
||||
int v = genrand_int32(d);
|
||||
|
||||
@@ -100,7 +100,8 @@ void get_kernel_name (const char *test_name, std::string &kernel_name)
|
||||
kernel_name.assign(temp_str);
|
||||
}
|
||||
|
||||
extern "C" void CL_CALLBACK notify_callback(const char *errInfo, const void *privateInfo, size_t cb, void *userData);
|
||||
void CL_CALLBACK notify_callback(const char* errInfo, const void* privateInfo,
|
||||
size_t cb, void* userData);
|
||||
|
||||
void create_context_and_queue(cl_device_id device, cl_context *out_context, cl_command_queue *out_queue)
|
||||
{
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
|
||||
extern MTdata gMTdata;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int test_sub_group_info(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements);
|
||||
extern int test_work_item_functions(cl_device_id device, cl_context context,
|
||||
@@ -41,8 +37,4 @@ extern int test_barrier_functions(cl_device_id device, cl_context context,
|
||||
extern int test_pipe_functions(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*_procs_h*/
|
||||
|
||||
Reference in New Issue
Block a user