Start converting host code to HIP

This commit is contained in:
Andrzej Janik 2021-08-27 17:27:48 +00:00
commit 4ae7feb93a
10 changed files with 5806 additions and 0 deletions

View file

@ -0,0 +1,8 @@
[package]
name = "hip_runtime-sys"
version = "0.0.0"
authors = ["Andrzej Janik <vosen@vosen.pl>"]
edition = "2018"
links = "amdhip"
[lib]

2
hip_runtime-sys/README Normal file
View file

@ -0,0 +1,2 @@
bindgen include/hip_runtime_api.h -o src/hip_runtime_api.rs --no-layout-tests --size_t-is-usize --default-enum-style=newtype --whitelist-function "hip.*" --whitelist-type "hip.*" -- -I/opt/rocm/include
sed -i 's/pub struct hipError_t/#[must_use]\npub struct hipError_t/g' src/hip_runtime_api.rs

7
hip_runtime-sys/build.rs Normal file
View file

@ -0,0 +1,7 @@
use std::env::VarError;
fn main() -> Result<(), VarError> {
println!("cargo:rustc-link-lib=dylib=amdhip64");
println!("cargo:rustc-link-search=/opt/rocm/lib/");
Ok(())
}

View file

@ -0,0 +1,2 @@
#define __HIP_PLATFORM_HCC__
#include <hip/hip_runtime_api.h>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
#![allow(warnings)]
pub mod hip_runtime_api;
pub use hip_runtime_api::*;