diff --git a/hipify_torch/cuda_to_hip_mappings.py b/hipify_torch/cuda_to_hip_mappings.py index 118e819..473466c 100644 --- a/hipify_torch/cuda_to_hip_mappings.py +++ b/hipify_torch/cuda_to_hip_mappings.py @@ -8392,6 +8392,8 @@ API_PYTORCH, ), ), + ("cuda::CUDAEvent", ("hip::HIPEventMasqueradingAsCUDA", API_PYTORCH)), + ("CUDAEvent", ("HIPEventMasqueradingAsCUDA", API_PYTORCH)), ("cuda::CUDAStream", ("hip::HIPStreamMasqueradingAsCUDA", API_PYTORCH)), ("CUDAStream", ("HIPStreamMasqueradingAsCUDA", API_PYTORCH)), ( @@ -8446,6 +8448,14 @@ "c10/cuda/CUDACachingAllocator.h", ("ATen/hip/impl/HIPCachingAllocatorMasqueradingAsCUDA.h", API_PYTORCH), ), + ( + "ATen/cuda/CUDAEvent.h", # To keep BC, we have to keep this mapping + ("ATen/hip/HIPEvent.h", API_PYTORCH), + ), + ( + "c10/cuda/CUDAEvent.h", + ("ATen/hip/impl/HIPEventMasqueradingAsCUDA.h", API_PYTORCH), + ), ( "c10/cuda/CUDAStream.h", ("ATen/hip/impl/HIPStreamMasqueradingAsCUDA.h", API_PYTORCH), @@ -8575,6 +8585,7 @@ ("c10/cuda/CUDAMathCompat.h", ("c10/hip/HIPMathCompat.h", API_C10)), ("c10/cuda/CUDAFunctions.h", ("c10/hip/HIPFunctions.h", API_C10)), ("c10/cuda/CUDAMiscFunctions.h", ("c10/hip/HIPMiscFunctions.h", API_C10)), + ("c10/cuda/CUDAEvent.h", ("c10/hip/HIPEvent.h", API_C10)), ("c10/cuda/CUDAStream.h", ("c10/hip/HIPStream.h", API_C10)), ("c10/cuda/CUDAGraphsC10Utils.h", ("c10/hip/HIPGraphsC10Utils.h", API_C10)), ("c10/cuda/CUDACachingAllocator.h", ("c10/hip/HIPCachingAllocator.h", API_C10)), @@ -8590,6 +8601,8 @@ ("C10_CUDA_IGNORE_ERROR", ("C10_HIP_IGNORE_ERROR", API_C10)), ("C10_CUDA_CLEAR_ERROR", ("C10_HIP_CLEAR_ERROR", API_C10)), ("c10::cuda", ("c10::hip", API_C10)), + ("cuda::CUDAEvent", ("hip::HIPEvent", API_C10)), + ("CUDAEvent", ("HIPEvent", API_C10)), ("cuda::CUDAStream", ("hip::HIPStream", API_C10)), ("CUDAStream", ("HIPStream", API_C10)), # This substitution is not permissible, because there's another copy of this