Skip to content

Commit

Permalink
put comgr in it's own file
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Jan 26, 2024
1 parent 3b39fa0 commit 45be538
Show file tree
Hide file tree
Showing 3 changed files with 907 additions and 751 deletions.
6 changes: 5 additions & 1 deletion generate_hip.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -e
clang2py -k acdefstu /opt/rocm/include/amd_comgr/amd_comgr.h /opt/rocm/include/hip/hip_ext.h /opt/rocm/include/hip/hiprtc.h /opt/rocm/include/hip/hip_runtime_api.h /opt/rocm/include/hip/driver_types.h --clang-args="-D__HIP_PLATFORM_AMD__ -I/opt/rocm/include -x c++" -o gpuctypes/hip.py -l /opt/rocm/lib/libhiprtc.so -l /opt/rocm/lib/libamdhip64.so -l /opt/rocm/lib/libamd_comgr.so
clang2py /opt/rocm/include/hip/hip_ext.h /opt/rocm/include/hip/hiprtc.h /opt/rocm/include/hip/hip_runtime_api.h /opt/rocm/include/hip/driver_types.h --clang-args="-D__HIP_PLATFORM_AMD__ -I/opt/rocm/include -x c++" -o gpuctypes/hip.py -l /opt/rocm/lib/libhiprtc.so -l /opt/rocm/lib/libamdhip64.so -l /opt/rocm/lib/libamd_comgr.so
echo "hipDeviceProp_t = hipDeviceProp_tR0600" >> gpuctypes/hip.py
echo "hipGetDeviceProperties = hipGetDevicePropertiesR0600" >> gpuctypes/hip.py
grep FIXME_STUB gpuctypes/hip.py || true
Expand All @@ -8,3 +8,7 @@ grep FIXME_STUB gpuctypes/hip.py || true
#sed -i "s\ctypes.CDLL('/opt/rocm/lib/libhiprtc.so')\ctypes.CDLL(ctypes.util.find_library('hiprtc'))\g" gpuctypes/hip.py
#sed -i "s\ctypes.CDLL('/opt/rocm/lib/libamdhip64.so')\ctypes.CDLL(ctypes.util.find_library('amdhip64'))\g" gpuctypes/hip.py
python3 -c "import gpuctypes.hip"

clang2py /opt/rocm/include/amd_comgr/amd_comgr.h --clang-args="-D__HIP_PLATFORM_AMD__ -I/opt/rocm/include -x c++" -o gpuctypes/comgr.py -l /opt/rocm/lib/libamd_comgr.so
grep FIXME_STUB gpuctypes/comgr.py || true
python3 -c "import gpuctypes.comgr"
Loading

0 comments on commit 45be538

Please sign in to comment.