mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[ROCm][Windows] Fix export macros (#144098)
For correct import and export of functions when the dynamic linkage is used for HIP libraries on windows, the appropriate export/import macros need to be put in place. This Pull Request utilizes existing CUDA import/export macros by converting them to corresponding HIP macros during the hipification process. Pull Request resolved: https://github.com/pytorch/pytorch/pull/144098 Approved by: https://github.com/jeffdaily
This commit is contained in:
committed by
PyTorch MergeBot
parent
45ef3309e3
commit
93633d0e80
@ -139,8 +139,10 @@
|
||||
#endif
|
||||
|
||||
#if defined(TORCH_HIP_BUILD_MAIN_LIB)
|
||||
#define TORCH_HIP_CPP_API C10_EXPORT
|
||||
#define TORCH_HIP_API C10_EXPORT
|
||||
#else
|
||||
#define TORCH_HIP_CPP_API C10_IMPORT
|
||||
#define TORCH_HIP_API C10_IMPORT
|
||||
#endif
|
||||
|
||||
|
@ -8422,6 +8422,8 @@ CUDA_SPECIAL_MAP = collections.OrderedDict(
|
||||
PYTORCH_SPECIFIC_MAPPINGS = collections.OrderedDict(
|
||||
[
|
||||
("USE_CUDA", ("USE_ROCM", API_PYTORCH)),
|
||||
("TORCH_CUDA_CPP_API", ("TORCH_HIP_CPP_API", API_PYTORCH)),
|
||||
("TORCH_CUDA_CU_API", ("TORCH_HIP_API", API_PYTORCH)),
|
||||
("CUDA_VERSION", ("TORCH_HIP_VERSION", API_PYTORCH)),
|
||||
("cudaHostAllocator", ("hipHostAllocator", API_PYTORCH)),
|
||||
("cudaDeviceAllocator", ("hipDeviceAllocator", API_PYTORCH)),
|
||||
|
Reference in New Issue
Block a user