|
| 1 | +// Copyright 2023 Advanced Micro Devices, Inc. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +#ifndef SIMULATOR_CUDA2HIP_H_ |
| 16 | +#define SIMULATOR_CUDA2HIP_H_ |
| 17 | + |
| 18 | +#define cublasCaxpy hipblasCaxpy |
| 19 | +#define cublasCdotc hipblasCdotc |
| 20 | +#define cublasCreate hipblasCreate |
| 21 | +#define cublasCscal hipblasCscal |
| 22 | +#define cublasCsscal hipblasCsscal |
| 23 | +#define cublasDestroy hipblasDestroy |
| 24 | +#define cublasDznrm2 hipblasDznrm2 |
| 25 | +#define cublasHandle_t hipblasHandle_t |
| 26 | +#define cublasScnrm2 hipblasScnrm2 |
| 27 | +#define CUBLAS_STATUS_SUCCESS HIPBLAS_STATUS_SUCCESS |
| 28 | +#define cublasStatus_t hipblasStatus_t |
| 29 | +#define cublasZaxpy hipblasZaxpy |
| 30 | +#define cublasZdotc hipblasZdotc |
| 31 | +#define cublasZdscal hipblasZdscal |
| 32 | +#define cublasZscal hipblasZscal |
| 33 | +#define cuCimagf hipCimagf |
| 34 | +#define cuCimag hipCimag |
| 35 | +#define cuComplex hipComplex |
| 36 | +#define cuCrealf hipCrealf |
| 37 | +#define cuCreal hipCreal |
| 38 | +#define CUDA_C_32F HIPBLAS_C_32F |
| 39 | +#define CUDA_C_64F HIPBLAS_C_64F |
| 40 | +#define cudaDeviceSynchronize hipDeviceSynchronize |
| 41 | +#define cudaError_t hipError_t |
| 42 | +#define cudaFree hipFree |
| 43 | +#define cudaGetErrorString hipGetErrorString |
| 44 | +#define cudaMalloc hipMalloc |
| 45 | +#define cudaMemcpyAsync hipMemcpyAsync |
| 46 | +#define cudaMemcpyDeviceToDevice hipMemcpyDeviceToDevice |
| 47 | +#define cudaMemcpyDeviceToHost hipMemcpyDeviceToHost |
| 48 | +#define cudaMemcpy hipMemcpy |
| 49 | +#define cudaMemcpyHostToDevice hipMemcpyHostToDevice |
| 50 | +#define cudaMemset hipMemset |
| 51 | +#define cudaPeekAtLastError hipPeekAtLastError |
| 52 | +#define cudaSuccess hipSuccess |
| 53 | +#define cuDoubleComplex hipDoubleComplex |
| 54 | + |
| 55 | +template <typename T> |
| 56 | +__device__ __forceinline__ T __shfl_down_sync( |
| 57 | + unsigned mask, T var, unsigned int delta, int width = warpSize) { |
| 58 | + return __shfl_down(var, delta, width); |
| 59 | +} |
| 60 | + |
| 61 | +#endif // SIMULATOR_CUDA2HIP_H_ |
0 commit comments