36 lines
684 B
C
36 lines
684 B
C
#pragma once
|
|
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <float.h>
|
|
#include <math.h>
|
|
|
|
#include <curand_kernel.h>
|
|
|
|
//------------------------------------------------------------------------------------------
|
|
//~ base defines
|
|
|
|
#define host_global static
|
|
#define function static
|
|
|
|
//~ typedefs
|
|
typedef int32_t S32;
|
|
typedef uint32_t U32;
|
|
typedef uint64_t U64;
|
|
typedef float F32;
|
|
|
|
//~ utility defines
|
|
|
|
#define CUDA_CHECK(err) do { \
|
|
if (err != cudaSuccess) { \
|
|
fprintf(stderr, "CUDA ERROR: %s at %s:%d\n", \
|
|
cudaGetErrorString(err), __FILE__, __LINE__); \
|
|
exit(EXIT_FAILURE); \
|
|
} \
|
|
} while (0)
|
|
|
|
#define LOG printf
|
|
|
|
#define F32_MAX FLT_MAX
|
|
#define F32_MIN FLT_MIN
|