Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU Support via OpenCL #1377

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
on:
push:
branches:
- "**"
pull_request:
merge_group:
workflow_dispatch:
workflow_call:

name: Continuous integration

env:
CARGO_TERM_COLOR: always
HOST: x86_64-unknown-linux-gnu
FEATURES: "test docs"
RUSTFLAGS: "-D warnings"
# RUSTFLAGS: "-D warnings" # For now, we don't mind a couple warnings

jobs:
clippy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- beta
Expand All @@ -30,6 +36,7 @@ jobs:
format:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- nightly
Expand All @@ -45,12 +52,13 @@ jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
- nightly
- 1.57.0 # MSRV
- 1.63.0 # MSRV

name: tests/${{ matrix.rust }}
steps:
Expand All @@ -67,6 +75,7 @@ jobs:
if: ${{ github.event_name == 'merge_group' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- rust: stable
Expand All @@ -90,6 +99,8 @@ jobs:
if: ${{ github.event_name == 'merge_group' }}
runs-on: ubuntu-latest
name: cargo-careful
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand All @@ -105,6 +116,7 @@ jobs:
if: ${{ github.event_name == 'merge_group' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
Expand All @@ -125,6 +137,8 @@ jobs:
- cargo-careful
- docs
if: always()
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Result
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Cargo.lock
target/

.DS_Store
34 changes: 25 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
name = "ndarray"
version = "0.15.6"
edition = "2018"
rust-version = "1.57"
rust-version = "1.63"
authors = [
"Ulrik Sverdrup \"bluss\"",
"Jim Turner"
"Ulrik Sverdrup \"bluss\"",
"Jim Turner",
"Toby Davis \"Pencilcaseman\"",
]
license = "MIT OR Apache-2.0"
readme = "README-crates.io.md"
Expand All @@ -31,33 +32,46 @@ num-integer = { version = "0.1.39", default-features = false }
num-traits = { version = "0.2", default-features = false }
num-complex = { version = "0.4", default-features = false }

# Use via the `opencl` crate feature!
hasty_ = { version = "0.2", optional = true, package = "hasty", default-features = false }
#hasty_ = { path = "../../hasty_dev/hasty", optional = true, package = "hasty", default-features = false }
#once_cell_ = { version = "1.19", optional = true, package = "once_cell" }

# Use via the `rayon` crate feature!
rayon_ = { version = "1.0.3", optional = true, package = "rayon" }

approx = { version = "0.4", optional = true , default-features = false }
approx-0_5 = { package = "approx", version = "0.5", optional = true , default-features = false }
approx = { version = "0.4", optional = true, default-features = false }
approx-0_5 = { package = "approx", version = "0.5", optional = true, default-features = false }

# Use via the `blas` crate feature!
cblas-sys = { version = "0.1.4", optional = true, default-features = false }
libc = { version = "0.2.82", optional = true }

matrixmultiply = { version = "0.3.2", default-features = false, features=["cgemm"] }
matrixmultiply = { version = "0.3.2", default-features = false, features = [
"cgemm",
] }

serde = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
serde = { version = "1.0", optional = true, default-features = false, features = [
"alloc",
] }
rawpointer = { version = "0.2" }

[dev-dependencies]
defmac = "0.2"
quickcheck = { version = "1.0", default-features = false }
approx = "0.4"
itertools = { version = "0.10.0", default-features = false, features = ["use_std"] }
itertools = { version = "0.12", default-features = false, features = ["use_std"] }

[features]
default = ["std"]

# Enable OpenCL backend
opencl = ["hasty_/opencl"]
cuda = ["hasty_/cuda"]

# Enable blas usage
# See README for more instructions
blas = ["cblas-sys", "libc"]
blas = ["cblas-sys", "libc", "hasty_/blas"]

# Old name for the serde feature
serde-1 = ["serde"]
Expand All @@ -75,8 +89,10 @@ matrixmultiply-threading = ["matrixmultiply/threading"]

[profile.bench]
debug = true

[profile.dev.package.numeric-tests]
opt-level = 2

[profile.test.package.numeric-tests]
opt-level = 2

Expand Down
1 change: 0 additions & 1 deletion README-crates.io.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

`ndarray` implements an *n*-dimensional container for general elements and for
numerics.

Expand Down
Loading