mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Remove "C" linkages (#781)
* Remove extern C linkages * Update crc32 to cpp and remove extern C linkage
This commit is contained in:
@@ -6,7 +6,7 @@ set(HARNESS_SOURCES
|
||||
harness/conversions.cpp
|
||||
harness/rounding_mode.cpp
|
||||
harness/msvc9.c
|
||||
harness/crc32.c
|
||||
harness/crc32.cpp
|
||||
harness/errorHelpers.cpp
|
||||
harness/genericThread.cpp
|
||||
harness/imageHelpers.cpp
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
#include <CL/cl.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
// An atomic add operator
|
||||
cl_int ThreadPool_AtomicAdd( volatile cl_int *a, cl_int b ); // returns old value
|
||||
@@ -68,9 +64,5 @@ cl_uint GetThreadCount( void );
|
||||
// otherwise the behavior is indefined. It may not be called from a TPFuncPtr.
|
||||
void SetThreadCount( int count );
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* THREAD_POOL_H */
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
#include <stdio.h>
|
||||
#include "errorHelpers.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// helper function to replace clCreateImage2D , to make the existing code use
|
||||
// the functions of version 1.2 and veriosn 1.1 respectively
|
||||
@@ -283,8 +279,4 @@ extern "C" {
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Note: the next three all have to match in size and order!! */
|
||||
|
||||
enum ExplicitTypes
|
||||
@@ -122,10 +118,6 @@ static inline int IsHalfSubnormal( cl_half x )
|
||||
return ( ( x & 0x7fffU ) - 1U ) < 0x03ffU;
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _conversions_h
|
||||
|
||||
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
/*-
|
||||
* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or
|
||||
* code or tables extracted from it, as desired without restriction.
|
||||
*
|
||||
* First, the polynomial itself and its table of feedback terms. The
|
||||
* polynomial is
|
||||
* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0
|
||||
*
|
||||
* Note that we take it "backwards" and put the highest-order term in
|
||||
* the lowest-order bit. The X^32 term is "implied"; the LSB is the
|
||||
* X^31 term, etc. The X^0 term (usually shown as "+1") results in
|
||||
* the MSB being 1
|
||||
*
|
||||
* Note that the usual hardware shift register implementation, which
|
||||
* is what we're using (we're merely optimizing it by doing eight-bit
|
||||
* chunks at a time) shifts bits into the lowest-order term. In our
|
||||
* implementation, that means shifting towards the right. Why do we
|
||||
* do it this way? Because the calculated CRC must be transmitted in
|
||||
* order from highest-order term to lowest-order term. UARTs transmit
|
||||
* characters in order from LSB to MSB. By storing the CRC this way
|
||||
* we hand it to the UART in the order low-byte to high-byte; the UART
|
||||
* sends each low-bit to hight-bit; and the result is transmission bit
|
||||
* by bit from highest- to lowest-order term without requiring any bit
|
||||
* shuffling on our part. Reception works similarly
|
||||
*
|
||||
* The feedback terms table consists of 256, 32-bit entries. Notes
|
||||
*
|
||||
* The table can be generated at runtime if desired; code to do so
|
||||
* is shown later. It might not be obvious, but the feedback
|
||||
* terms simply represent the results of eight shift/xor opera
|
||||
* tions for all combinations of data and CRC register values
|
||||
*
|
||||
* The values must be right-shifted by eight bits by the "updcrc
|
||||
* logic; the shift must be unsigned (bring in zeroes). On some
|
||||
* hardware you could probably optimize the shift in assembler by
|
||||
* using byte-swap instructions
|
||||
* polynomial $edb88320
|
||||
*
|
||||
*
|
||||
* CRC32 code derived from work by Gary S. Brown.
|
||||
*/
|
||||
|
||||
#include "crc32.h"
|
||||
|
||||
static uint32_t crc32_tab[] = {
|
||||
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
|
||||
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
|
||||
0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
|
||||
0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
|
||||
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
|
||||
0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
|
||||
0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
|
||||
0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
|
||||
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
|
||||
0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
|
||||
0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
|
||||
0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
|
||||
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
|
||||
0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
|
||||
0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
|
||||
0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
|
||||
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
|
||||
0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
|
||||
0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
|
||||
0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
|
||||
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
|
||||
0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
|
||||
0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
|
||||
0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
|
||||
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
|
||||
0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
|
||||
0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
|
||||
0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
|
||||
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
|
||||
0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
|
||||
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
|
||||
0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
|
||||
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
|
||||
0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
|
||||
0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
|
||||
0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
|
||||
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
|
||||
0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
|
||||
0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
|
||||
0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
||||
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
|
||||
0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
|
||||
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
|
||||
};
|
||||
|
||||
uint32_t
|
||||
crc32(const void *buf, size_t size)
|
||||
{
|
||||
const uint8_t *p;
|
||||
|
||||
p = (const uint8_t*)buf;
|
||||
uint32_t crc = ~0U;
|
||||
|
||||
while (size--)
|
||||
crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8);
|
||||
|
||||
return crc ^ ~0U;
|
||||
}
|
||||
|
||||
101
test_common/harness/crc32.cpp
Normal file
101
test_common/harness/crc32.cpp
Normal file
@@ -0,0 +1,101 @@
|
||||
/*-
|
||||
* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or
|
||||
* code or tables extracted from it, as desired without restriction.
|
||||
*
|
||||
* First, the polynomial itself and its table of feedback terms. The
|
||||
* polynomial is
|
||||
* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0
|
||||
*
|
||||
* Note that we take it "backwards" and put the highest-order term in
|
||||
* the lowest-order bit. The X^32 term is "implied"; the LSB is the
|
||||
* X^31 term, etc. The X^0 term (usually shown as "+1") results in
|
||||
* the MSB being 1
|
||||
*
|
||||
* Note that the usual hardware shift register implementation, which
|
||||
* is what we're using (we're merely optimizing it by doing eight-bit
|
||||
* chunks at a time) shifts bits into the lowest-order term. In our
|
||||
* implementation, that means shifting towards the right. Why do we
|
||||
* do it this way? Because the calculated CRC must be transmitted in
|
||||
* order from highest-order term to lowest-order term. UARTs transmit
|
||||
* characters in order from LSB to MSB. By storing the CRC this way
|
||||
* we hand it to the UART in the order low-byte to high-byte; the UART
|
||||
* sends each low-bit to hight-bit; and the result is transmission bit
|
||||
* by bit from highest- to lowest-order term without requiring any bit
|
||||
* shuffling on our part. Reception works similarly
|
||||
*
|
||||
* The feedback terms table consists of 256, 32-bit entries. Notes
|
||||
*
|
||||
* The table can be generated at runtime if desired; code to do so
|
||||
* is shown later. It might not be obvious, but the feedback
|
||||
* terms simply represent the results of eight shift/xor opera
|
||||
* tions for all combinations of data and CRC register values
|
||||
*
|
||||
* The values must be right-shifted by eight bits by the "updcrc
|
||||
* logic; the shift must be unsigned (bring in zeroes). On some
|
||||
* hardware you could probably optimize the shift in assembler by
|
||||
* using byte-swap instructions
|
||||
* polynomial $edb88320
|
||||
*
|
||||
*
|
||||
* CRC32 code derived from work by Gary S. Brown.
|
||||
*/
|
||||
|
||||
#include "crc32.h"
|
||||
|
||||
static uint32_t crc32_tab[] = {
|
||||
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
|
||||
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
|
||||
0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
|
||||
0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
|
||||
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
|
||||
0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
|
||||
0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
|
||||
0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
|
||||
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
|
||||
0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
|
||||
0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
|
||||
0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
|
||||
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
|
||||
0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
|
||||
0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
|
||||
0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
|
||||
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
|
||||
0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
|
||||
0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
|
||||
0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
|
||||
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
|
||||
0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
|
||||
0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
|
||||
0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
|
||||
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
|
||||
0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
|
||||
0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
|
||||
0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
|
||||
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
|
||||
0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
|
||||
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
|
||||
0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
|
||||
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
|
||||
0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
|
||||
0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
|
||||
0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
|
||||
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
|
||||
0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
|
||||
0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
|
||||
0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
||||
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
|
||||
0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
|
||||
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
|
||||
};
|
||||
|
||||
uint32_t crc32(const void *buf, size_t size)
|
||||
{
|
||||
const uint8_t *p;
|
||||
|
||||
p = (const uint8_t *)buf;
|
||||
uint32_t crc = ~0U;
|
||||
|
||||
while (size--) crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8);
|
||||
|
||||
return crc ^ ~0U;
|
||||
}
|
||||
@@ -21,14 +21,6 @@ executed between Khronos and the recipient.
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint32_t crc32(const void *buf, size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,17 +23,9 @@
|
||||
|
||||
#include <CL/opencl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/* Determines if an extension is supported by a device. */
|
||||
int is_extension_available(cl_device_id device, const char *extensionName);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
/* Returns a string containing the supported extensions list for a device. */
|
||||
std::string get_device_extensions_string(cl_device_id device);
|
||||
|
||||
|
||||
@@ -24,10 +24,6 @@
|
||||
#include <CL/opencl.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define LOWER_IS_BETTER 0
|
||||
#define HIGHER_IS_BETTER 1
|
||||
|
||||
@@ -150,10 +146,6 @@ static int vlog_win32(const char *format, ...)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _errorHelpers_h
|
||||
|
||||
|
||||
|
||||
@@ -40,10 +40,6 @@
|
||||
#include "deviceInfo.h"
|
||||
#include "harness/alloc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/*
|
||||
* The below code is intended to be used at the top of kernels that appear inline in files to set line and file info for the kernel:
|
||||
*
|
||||
@@ -177,8 +173,4 @@ cl_device_fp_config get_default_rounding_mode( cl_device_id device );
|
||||
/* Prints out the standard device header for all tests given the device to print for */
|
||||
extern int printDeviceHeader( cl_device_id device );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // _kernelHelpers_h
|
||||
|
||||
@@ -55,10 +55,6 @@
|
||||
#include <CL/cl_platform.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interfaces here have been modified from original sources so that they
|
||||
* are safe to call reentrantly, so long as a different MTdata is used
|
||||
@@ -92,10 +88,6 @@ double genrand_real3( MTdata /*data*/);
|
||||
double genrand_res53( MTdata /*data*/ );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <cassert>
|
||||
|
||||
@@ -37,17 +37,9 @@
|
||||
// C interface.
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
char * get_err_msg( int err ); // Returns system error message. Subject to free.
|
||||
char * get_dir_sep(); // Returns dir separator. Subject to free.
|
||||
char * get_exe_path(); // Returns path of current executable. Subject to free.
|
||||
char * get_exe_dir(); // Returns dir of current executable. Subject to free.
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __os_helpers_h__
|
||||
|
||||
@@ -51,19 +51,11 @@ typedef enum
|
||||
kTypeCount
|
||||
}Type;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern RoundingMode set_round( RoundingMode r, Type outType );
|
||||
extern RoundingMode get_round( void );
|
||||
extern void *FlushToZero( void );
|
||||
extern void UnFlushToZero( void *p);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* __ROUNDING_MODE_H__ */
|
||||
|
||||
@@ -48,10 +48,6 @@ private:
|
||||
|
||||
Version get_device_cl_version(cl_device_id device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ADD_TEST(fn) \
|
||||
{ \
|
||||
test_##fn, #fn, Version(1, 0) \
|
||||
@@ -152,9 +148,6 @@ extern int gIsOpenCL_C_1_0_Device; // This is set to 1 if the device suppor
|
||||
void memset_pattern4(void *, const void *, size_t);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
extern void PrintArch(void);
|
||||
|
||||
|
||||
|
||||
@@ -29,9 +29,6 @@
|
||||
#include "errorHelpers.h"
|
||||
#include "kernelHelpers.h"
|
||||
|
||||
extern "C" cl_uint gReSeed;
|
||||
extern "C" cl_uint gRandomSeed;
|
||||
|
||||
/* cl_context wrapper */
|
||||
|
||||
class clContextWrapper
|
||||
|
||||
@@ -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