Skip to content

Commit

Permalink
Remove default features
Browse files Browse the repository at this point in the history
  • Loading branch information
kenba committed Nov 30, 2024
1 parent ef8149d commit 4bf4aca
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 37 deletions.
53 changes: 22 additions & 31 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,30 @@ env:
CARGO_TERM_COLOR: always

jobs:
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
# Tests "runs-on:" a GPU hosted runner which requires an enterprise subscription...
# test:
# name: Tests
# 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@v2
- name: Build
run: cargo build --verbose
# - name: Run tests
# run: cargo test --verbose
# - uses: actions/checkout@v4
# - name: Install Rust
# run: rustup update stable
# - name: Unit test
# run: cargo test --verbose -- --test-threads=1

clippy:
name: Clippy
Expand Down
10 changes: 4 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ edition = "2021"
[features]

static = ["cl3/static"]
dynamic = ["cl3/dynamic"]

# CL_VERSION_1_0 = ["cl3/CL_VERSION_1_0"]
CL_VERSION_1_1 = ["cl3/CL_VERSION_1_1"]
CL_VERSION_1_2 = ["cl3/CL_VERSION_1_2"]
CL_VERSION_2_0 = ["cl3/CL_VERSION_2_0"]
Expand Down Expand Up @@ -68,9 +66,8 @@ cl_loader_info = ["cl3/cl_loader_info"]
cl_pocl_content_size = ["cl3/cl_pocl_content_size"]
cl_loader_layers = ["cl3/cl_loader_layers"]

# Default features:
default = ["static", "CL_VERSION_1_1", "CL_VERSION_1_2", "CL_VERSION_2_0"]
# default = ["dynamic"]
# Use dynamic linking instead of static linking
dynamic = ["cl3/dynamic"]

[dependencies]
libc = "0.2"
Expand All @@ -80,7 +77,8 @@ serde = { version = "1.0", optional = true }

[dev-dependencies]
serde_json = "1.0"
opencl3 = { path = ".", features = ["serde"] }
opencl3 = { path = ".", features = ["serde", "static", "CL_VERSION_1_1", "CL_VERSION_1_2", "CL_VERSION_2_0"] }
# opencl3 = { path = ".", features = ["serde", "dynamic"] }

[lints.clippy]
enum_glob_use = "deny"
Expand Down

0 comments on commit 4bf4aca

Please sign in to comment.