#include <stdio.h>
#include <unistd.h>
#include <memory>
Go to the source code of this file.
|
void | testinit () |
| Sets a global variable to true if the STDOUT is a terminal. Needs to be done like so because while a kernel is able to print to stdout, it is unable to execute isatty. More...
|
|
◆ clearRes
Value: for (int i = 0; i < 16 * 512; i++) \
cmp[i] = 0; \
pass = true;
Definition at line 87 of file test.h.
◆ clearRes512
Value: for (int i = 0; i < rows * 16 * 512; i++) \
cmp[i] = 0; \
pass = true;
Definition at line 92 of file test.h.
◆ CLOCKEND
Value: end = clock(); \
printf(" (%.1f ms)\n", (end - start) * (1000. / CLOCKS_PER_SEC))
Definition at line 100 of file test.h.
◆ CLOCKINIT
#define CLOCKINIT clock_t start, end |
◆ CLOCKSTART
#define CLOCKSTART start = clock() |
◆ CMPCHECK
#define CMPCHECK |
( |
|
LENGTH | ) |
|
Value: for (int i = 0; pass && i < LENGTH; i++) { \
if (cmp[i] != 1) { \
printf("%s:%d %s() error idx %d...\n", __FILE__, __LINE__, __func__, i); \
pass = false; \
break; \
} \
}
Definition at line 106 of file test.h.
◆ COLOR_BOLD
#define COLOR_BOLD "\x1b[1m" |
◆ COLOR_GREEN
#define COLOR_GREEN "\x1b[32m" |
◆ COLOR_RED
#define COLOR_RED "\x1b[31m" |
◆ COLOR_RESET
#define COLOR_RESET "\x1b[0m" |
◆ CUDASYNC
#define CUDASYNC |
( |
|
fmt, |
|
|
|
... |
|
) |
| |
Value: err = cudaDeviceSynchronize(); \
if (err != cudaSuccess) \
printf("%s:%d " fmt " Error: %d (%s)\n", __FILE__, __LINE__, err, cudaGetErrorName(err), ##__VA_ARGS__)
Definition at line 70 of file test.h.
◆ NEGCMPCHECK
#define NEGCMPCHECK |
( |
|
LENGTH | ) |
|
Value: for (int i = 0; pass && i < LENGTH; i++) { \
if (cmp[i] != 1) { \
pass = false; \
break; \
} \
}
Definition at line 116 of file test.h.
◆ NEGPRINTPASS
#define NEGPRINTPASS |
( |
|
pass | ) |
|
Value: if (isatty(fileno(stdout))){ \
}else{\
printf("--- %s\n", pass ? "FAIL" : "PASS" );\
}
Definition at line 32 of file test.h.
◆ PRINTPASS
#define PRINTPASS |
( |
|
pass | ) |
|
Value:
}else{ \
printf("--- %s\n", pass ? "PASS" : "FAIL" );\
}
__managed__ int stdout_isatty
Definition at line 25 of file test.h.
◆ SET_SHAREDMEM
#define SET_SHAREDMEM |
( |
|
SZ, |
|
|
|
FN |
|
) |
| |
Value: err = cudaFuncSetAttribute(FN, cudaFuncAttributeMaxDynamicSharedMemorySize, SZ); \
cudaDeviceSynchronize(); \
if (err != cudaSuccess) \
printf("Error cudaFuncSetAttribute: %s:%d, error %d (%s)\n", __FILE__, __LINE__, err, cudaGetErrorName(err));
Definition at line 79 of file test.h.
◆ WRITEU64
#define WRITEU64 |
( |
|
writing_stream, |
|
|
|
var, |
|
|
|
nu64Elem |
|
) |
| |
Value: do { \
uint64_t *pointer = (uint64_t *)(*var); \
for (int count = 0; count < (nu64Elem); count++) { \
fprintf(writing_stream, "%016lx\n", pointer[count]); \
} \
} while (0)
Definition at line 40 of file test.h.
◆ WRITEU64STDOUT
#define WRITEU64STDOUT |
( |
|
var, |
|
|
|
nu64Elem |
|
) |
| |
Value: do { \
uint64_t *pointer = (uint64_t *)(var); \
for (int count = 0; count < (nu64Elem); count++) { \
printf("%016lx ", pointer[count]); \
if (count % 6 == 5) \
printf("\n"); \
} \
} while (0)
Definition at line 57 of file test.h.
◆ WRITEU64TOFILE
#define WRITEU64TOFILE |
( |
|
fileName, |
|
|
|
var, |
|
|
|
nu64Elem |
|
) |
| |
Value: do { \
FILE *filepointer = fopen(fileName, "w"); \
WRITEU64(filepointer, var, (nu64Elem)); \
fclose(filepointer); \
} while (0)
Definition at line 48 of file test.h.
◆ testinit()
Sets a global variable to true if the STDOUT is a terminal. Needs to be done like so because while a kernel is able to print to stdout, it is unable to execute isatty.
Currently used so piping to a file doesn't output terminal control characters.
Definition at line 18 of file test.cu.
◆ stdout_isatty
__managed__ int stdout_isatty |
|
extern |