forked from ROCm/rccl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhipify.sh
executable file
·112 lines (110 loc) · 4.08 KB
/
hipify.sh
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved.
FILES="
./src/nccl.h.in
./src/bootstrap.cu
./src/collectives/all_gather.cu
./src/collectives/all_reduce.cu
./src/collectives/broadcast.cu
./src/collectives/collectives.h
./src/collectives/device/all_gather.cu
./src/collectives/device/all_gather.h
./src/collectives/device/all_reduce.cu
./src/collectives/device/all_reduce.h
./src/collectives/device/broadcast.cu
./src/collectives/device/broadcast.h
./src/collectives/device/common.h
./src/collectives/device/common_kernel.h
./src/collectives/device/functions.cu
./src/collectives/device/ll_kernel.h
./src/collectives/device/primitives.h
./src/collectives/device/reduce.cu
./src/collectives/device/reduce.h
./src/collectives/device/reduce_kernel.h
./src/collectives/device/reduce_scatter.cu
./src/collectives/device/reduce_scatter.h
./src/collectives/reduce.cu
./src/collectives/reduce_scatter.cu
./src/include/bootstrap.h
./src/include/common_coll.h
./src/include/core.h
./src/include/debug.h
./src/include/enqueue.h
./src/include/group.h
./src/include/ibvwrap.h
./src/include/nccl_net.h
./src/include/net.h
./src/include/nvlink.h
./src/include/nvmlwrap.h
./src/include/param.h
./src/include/ring.h
./src/include/rings.h
./src/include/shm.h
./src/include/socket.h
./src/include/topo.h
./src/include/transport.h
./src/include/utils.h
./src/init.cu
./src/misc/enqueue.cu
./src/misc/group.cu
./src/misc/ibvwrap.cu
./src/misc/nvmlwrap.cu
./src/misc/rings.cu
./src/misc/utils.cu
./src/ring.cu
./src/transport.cu
./src/transport/net.cu
./src/transport/net_ib.cu
./src/transport/net_socket.cu
./src/transport/p2p.cu
./src/transport/shm.cu
"
for f in $FILES
do
sed -i \
-e 's@cuda_runtime.h@hip/hip_runtime_api.h@g' \
-e 's@cuda_fp16.h@hip/hip_fp16.h@g' \
-e 's/cudaDeviceCanAccessPeer/hipDeviceCanAccessPeer/g' \
-e 's/cudaDeviceEnablePeerAccess/hipDeviceEnablePeerAccess/g' \
-e 's/cudaDeviceGetPCIBusId/hipDeviceGetPCIBusId/g' \
-e 's/cudaErrorPeerAccessAlreadyEnabled/hipErrorPeerAccessAlreadyEnabled/g' \
-e 's/cudaError_t/hipError_t/g' \
-e 's/cudaEventCreateWithFlags/hipEventCreateWithFlags/g' \
-e 's/cudaEventDestroy/hipEventDestroy/g' \
-e 's/cudaEventDisableTiming/hipEventDisableTiming/g' \
-e 's/cudaEventRecord/hipEventRecord/g' \
-e 's/cudaEvent_t/hipEvent_t/g' \
-e 's/cudaFree/hipFree/g' \
-e 's/cudaFreeHost/hipHostFree/g' \
-e 's/cudaGetDevice/hipGetDevice/g' \
-e 's/cudaGetErrorString/hipGetErrorString/g' \
-e 's/cudaGetLastError/hipGetLastError/g' \
-e 's/cudaHostAlloc/hipHostMalloc/g' \
-e 's/cudaHostAllocMapped/hipHostMallocMapped/g' \
-e 's/cudaHostGetDevicePointer/hipHostGetDevicePointer/g' \
-e 's/cudaHostRegister/hipHostRegister/g' \
-e 's/cudaHostRegisterMapped/hipHostRegisterMapped/g' \
-e 's/cudaHostUnregister/hipHostUnregister/g' \
-e 's/cudaIpcCloseMemHandle/hipIpcCloseMemHandle/g' \
-e 's/cudaIpcGetMemHandle/hipIpcGetMemHandle/g' \
-e 's/cudaIpcMemHandle_t/hipIpcMemHandle_t/g' \
-e 's/cudaIpcMemLazyEnablePeerAccess/hipIpcMemLazyEnablePeerAccess/g' \
-e 's/cudaIpcOpenMemHandle/hipIpcOpenMemHandle/g' \
-e 's/cudaMalloc/hipMalloc/g' \
-e 's/cudaMemcpy/hipMemcpy/g' \
-e 's/cudaMemcpyAsync/hipMemcpyAsync/g' \
-e 's/cudaMemcpyDefault/hipMemcpyDefault/g' \
-e 's/cudaMemcpyDeviceToDevice/hipMemcpyDeviceToDevice/g' \
-e 's/cudaMemoryTypeDevice/hipMemoryTypeDevice/g' \
-e 's/cudaMemset/hipMemset/g' \
-e 's/cudaPointerAttributes/hipPointerAttribute_t/g' \
-e 's/cudaPointerGetAttributes/hipPointerGetAttributes/g' \
-e 's/cudaSetDevice/hipSetDevice/g' \
-e 's/cudaStreamCreateWithFlags/hipStreamCreateWithFlags/g' \
-e 's/cudaStreamDestroy/hipStreamDestroy/g' \
-e 's/cudaStreamNonBlocking/hipStreamNonBlocking/g' \
-e 's/cudaStreamWaitEvent/hipStreamWaitEvent/g' \
-e 's/cudaStream_t/hipStream_t/g' \
-e 's/cudaSuccess/hipSuccess/g' \
$f
done