diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9843105..b2ec4ed 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,30 +10,42 @@ env: CARGO_TERM_COLOR: always jobs: - # Tests "runs-on:" a GPU hosted runner which requires an enterprise subscription... - # test: - # name: Tests - # runs-on: ubuntu-latest + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + run: rustup update stable + - name: Unit test + run: cargo check + + build: + name: Build + runs-on: ubuntu-latest - # steps: - # - name: Load OpenCL - # run: | - # wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | - # sudo apt-key add - - # sudo add-apt-repository \ - # 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' - # sudo apt-get update - # sudo apt-get install \ - # intel-opencl-icd \ - # intel-level-zero-gpu level-zero \ - # intel-media-va-driver-non-free libmfx1 - # sudo apt-get install ocl-icd-opencl-dev + steps: + - name: Load OpenCL + run: | + wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | + sudo apt-key add - + sudo add-apt-repository \ + 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' + sudo apt-get update + sudo apt-get install \ + intel-opencl-icd \ + intel-level-zero-gpu level-zero \ + intel-media-va-driver-non-free libmfx1 + sudo apt-get install ocl-icd-opencl-dev - # - uses: actions/checkout@v4 - # - name: Install Rust - # run: rustup update stable - # - name: Unit test - # run: cargo test --verbose -- --test-threads=1 + - uses: actions/checkout@v4 + - name: Install Rust + run: rustup update stable + - name: Build + run: cargo build --verbose + # Tests "runs-on:" a GPU hosted runner which requires an enterprise subscription... + # - name: Run tests + # run: cargo test -- --test-threads=1 clippy: name: Clippy diff --git a/Cargo.toml b/Cargo.toml index c5cd5b2..14e1bc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,16 +69,17 @@ cl_loader_layers = ["cl3/cl_loader_layers"] # Use dynamic linking instead of static linking dynamic = ["cl3/dynamic"] +# Default features: +default = ["dynamic"] + [dependencies] libc = "0.2" -# cl3 = "0.10" -cl3 = { git = "https://github.com/kenba/cl3", branch = "develop" } +cl3 = "0.11" serde = { version = "1.0", optional = true } [dev-dependencies] serde_json = "1.0" -opencl3 = { path = ".", features = ["serde", "static", "CL_VERSION_1_1", "CL_VERSION_1_2", "CL_VERSION_2_0"] } -# opencl3 = { path = ".", features = ["serde", "dynamic"] } +opencl3 = { path = ".", features = ["dynamic", "serde"] } [lints.clippy] enum_glob_use = "deny" diff --git a/src/platform.rs b/src/platform.rs index f6dbd0e..2881262 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -224,7 +224,7 @@ pub fn get_platforms() -> Result> { .collect::>()) } -#[cfg(feature = "cl_khr_icd")] +#[cfg(any(feature = "cl_khr_icd", feature = "dynamic"))] pub fn icd_get_platform_ids_khr() -> Result> { let platform_ids = ext::icd_get_platform_ids_khr()?; Ok(platform_ids