-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enable HIP build in windows > make changes to cmake files to enable HIP build on windows > Fix compilation errors > Tested xrt_flow using HIP apis on phoenix using MCDM flow Signed-off-by: rbramand <[email protected]> * Add hip.cmake config file with hip related configs Signed-off-by: rbramand <[email protected]> * Add proper path for hip.cmake inclusion when XRT is submodule Signed-off-by: rbramand <[email protected]> * Move hip_config.cmake to hip folder Signed-off-by: rbramand <[email protected]> --------- Signed-off-by: rbramand <[email protected]> Co-authored-by: rbramand <[email protected]>
- Loading branch information
1 parent
cad380f
commit d9b3373
Showing
12 changed files
with
110 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. | ||
|
||
message("-- Looking for HIP include files...") | ||
if (NOT WIN32) | ||
# We should find HIP cmake either in standard cmake locations or in the /opt/rocm location | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/lib/x86_64-linux-gnu/cmake/hip;/usr/lib/x86_64-linux-gnu/cmake/amd_comgr;/opt/rocm/lib/cmake/hip;/opt/rocm/lib/cmake/amd_comgr") | ||
# hip-config itself requires these other directories to find its dependencies | ||
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr/lib/x86_64-linux-gnu/cmake/hip;/usr/lib/x86_64-linux-gnu/cmake/amd_comgr;/usr/lib/x86_64-linux-gnu/cmake/hsa-runtime64;/opt/rocm/lib/cmake/hip;/opt/rocm/lib/cmake/amd_comgr;/opt/rocm/lib/cmake/hsa-runtime64") | ||
else () | ||
set(HIP_PLATFORM "amd") | ||
# HIP SDK installs hip files to C:/Program Files/AMD/ROCm | ||
# Latest version available on windows is 5.7 | ||
# Users can set HIP_DIR to location of HIP installation or default path is used | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} $ENV{HIP_DIR} "C:/Program Files/AMD/ROCm/5.7/lib/cmake/hip") | ||
endif () | ||
|
||
include(hip-config) | ||
message("-- Found at ${HIP_INCLUDE_DIR}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
; SPDX-License-Identifier: Apache-2.0 | ||
; Copyright (C) 2023-2024 Advanced Micro Device, Inc. All rights reserved. | ||
LIBRARY xrt_hip | ||
EXPORTS | ||
hipCtxCreate | ||
hipCtxDestroy | ||
hipCtxGetDevice | ||
hipCtxSetCurrent | ||
hipDevicePrimaryCtxRetain | ||
hipDevicePrimaryCtxRelease | ||
hipInit | ||
hipGetDeviceCount | ||
hipDeviceGet | ||
hipDeviceGetName | ||
hipGetDeviceProperties | ||
hipDeviceGetUuid | ||
hipDeviceGetAttribute | ||
hipDrvGetErrorName | ||
hipDrvGetErrorString | ||
hipGetErrorString | ||
hipGetErrorName | ||
hipExtGetLastError | ||
hipGetLastError | ||
hipPeekAtLastError | ||
hipEventCreate | ||
hipEventDestroy | ||
hipEventSynchronize | ||
hipEventRecord | ||
hipEventQuery | ||
hipEventElapsedTime | ||
hipMalloc | ||
hipHostMalloc | ||
hipHostFree | ||
hipFree | ||
hipHostRegister | ||
hipHostUnregister | ||
hipHostGetDevicePointer | ||
hipMemcpy | ||
hipMemset | ||
hipMemcpyHtoDAsync | ||
hipModuleLaunchKernel | ||
hipModuleGetFunction | ||
hipModuleLoadData | ||
hipModuleLoadDataEx | ||
hipModuleUnload | ||
hipFuncSetAttribute | ||
hipStreamCreateWithFlags | ||
hipStreamDestroy | ||
hipStreamSynchronize | ||
hipStreamWaitEvent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters