Peter Collingbourne | ced7671 | 2010-12-01 03:15:31 +0000 | [diff] [blame] | 1 | /* Minimal declarations for CUDA support. Testing purposes only. */ |
| 2 | |
Peter Collingbourne | bf36e25 | 2011-02-09 21:12:02 +0000 | [diff] [blame] | 3 | #include <stddef.h> |
| 4 | |
Peter Collingbourne | ced7671 | 2010-12-01 03:15:31 +0000 | [diff] [blame] | 5 | #define __constant__ __attribute__((constant)) |
| 6 | #define __device__ __attribute__((device)) |
| 7 | #define __global__ __attribute__((global)) |
| 8 | #define __host__ __attribute__((host)) |
| 9 | #define __shared__ __attribute__((shared)) |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 10 | #define __launch_bounds__(...) __attribute__((launch_bounds(__VA_ARGS__))) |
Peter Collingbourne | bf36e25 | 2011-02-09 21:12:02 +0000 | [diff] [blame] | 11 | |
| 12 | struct dim3 { |
| 13 | unsigned x, y, z; |
Peter Collingbourne | 78dd67e | 2011-10-02 23:49:40 +0000 | [diff] [blame] | 14 | __host__ __device__ dim3(unsigned x, unsigned y = 1, unsigned z = 1) : x(x), y(y), z(z) {} |
Peter Collingbourne | bf36e25 | 2011-02-09 21:12:02 +0000 | [diff] [blame] | 15 | }; |
| 16 | |
| 17 | typedef struct cudaStream *cudaStream_t; |
| 18 | |
| 19 | int cudaConfigureCall(dim3 gridSize, dim3 blockSize, size_t sharedSize = 0, |
| 20 | cudaStream_t stream = 0); |