Repository navigation
Expand file tree
/
Copy pathpreprocessor.hpp
More file actions
77 lines (72 loc) · 2.8 KB
/
Copy pathpreprocessor.hpp
File metadata and controls
77 lines (72 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef PREPROCESSHPP
#define PREPROCESSHPP
#include <string>
#include <sstream>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include<math.h>
#include<vector>
#include <chrono>
#include <thread>
#include<exception>
#include<set>
#include <mutex>
#include <condition_variable>
#include <cassert>
#if defined __CUDACC__
#include <cuda_fp16.h>
#define LOWLEVEL
#define hipMemcpyDtoH(x, y, z) cudaMemcpy(x, y, z, cudaMemcpyDeviceToHost)
#define hipMemcpyHtoD(x, y, z) cudaMemcpy(x, y, z, cudaMemcpyHostToDevice)
#define hipMemcpyDtoD(x, y, z) cudaMemcpy(x, y, z, cudaMemcpyDeviceToDevice)
#define hipMemcpyDtoHAsync(x, y, z, w) cudaMemcpyAsync(x, y, z, cudaMemcpyDeviceToHost, w)
#define hipMemcpyHtoDAsync(x, y, z, w) cudaMemcpyAsync(x, y, z, cudaMemcpyHostToDevice, w)
#define hipMemcpyDtoDAsync(x, y, z, w) cudaMemcpyAsync(x, y, z, cudaMemcpyDeviceToDevice, w)
#define hipMemcpyPeer cudaMemcpyPeer
#define hipMemcpyPeerAsync cudaMemcpyPeerAsync
#define hipMalloc cudaMalloc
#define hipFree cudaFree
#define hipDeviceSynchronize cudaDeviceSynchronize
#define hipSetDevice cudaSetDevice
#define hipDeviceProp_t cudaDeviceProp
#define hipGetDeviceCount cudaGetDeviceCount
#define hipDeviceptr_t void*
#define hipGetDevice cudaGetDevice
#define hipGetDeviceProperties cudaGetDeviceProperties
#define hipError_t cudaError_t
#define hipGetErrorString cudaGetErrorString
#define hipStream_t cudaStream_t
#define hipStreamAddCallback cudaStreamAddCallback
#define hipDeviceEnablePeerAccess cudaDeviceEnablePeerAccess
#define hipSuccess cudaSuccess
#define hipGetLastError cudaGetLastError
#define hipStreamCreate cudaStreamCreate
#define hipStreamDestroy cudaStreamDestroy
#define hipEventCreate cudaEventCreate
#define hipEventDestroy cudaEventDestroy
#define hipEventSynchronize cudaEventSynchronize
#define hipEventRecord cudaEventRecord
#define hipEvent_t cudaEvent_t
#define hipEventElapsedTime cudaEventElapsedTime
#define hipDeviceSetCacheConfig cudaDeviceSetCacheConfig
#define hipFuncCachePreferShared cudaFuncCachePreferShared
#define hipFuncCachePreferNone cudaFuncCachePreferNone
#define hipFuncCachePreferL1 cudaFuncCachePreferL1
#define hipFuncCachePreferEqual cudaFuncCachePreferEqual
#define hipMemGetInfo cudaMemGetInfo
#define hipMemsetAsync cudaMemsetAsync
#define hipMemset cudaMemset
#define hipMallocAsync cudaMallocAsync
#define hipFreeAsync cudaFreeAsync
#define hipHostFree cudaFreeHost
#define hipFreeHost cudaFreeHost
#define hipHostMalloc cudaMallocHost
#define hipStreamSynchronize cudaStreamSynchronize
#else
#include<hip/hip_runtime.h>
#include<hip/hip_fp16.h>
#endif
#define PI 3.14159265359
#define TAU 6.28318530718
#endif