diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..88ced05 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install ArrayFire + run: brew install arrayfire + + - name: Set up GHC + uses: haskell-actions/setup@v2 + with: + ghc-version: '9.8.4' + cabal-version: 'latest' + + - name: Cache cabal store + uses: actions/cache@v4 + with: + path: ~/.cabal/store + key: ${{ runner.os }}-cabal-${{ hashFiles('cabal.project', '*.cabal') }} + restore-keys: | + ${{ runner.os }}-cabal- + + - name: Configure + run: cabal configure --flags="disable-default-paths disable-build-tool-depends" --extra-include-dirs=$(brew --prefix arrayfire)/include --extra-lib-dirs=$(brew --prefix arrayfire)/lib + + - name: Build + run: cabal build arrayfire + diff --git a/src/ArrayFire/FFI.hs b/src/ArrayFire/FFI.hs index 483bc0f..e776ace 100644 --- a/src/ArrayFire/FFI.hs +++ b/src/ArrayFire/FFI.hs @@ -72,7 +72,7 @@ op2 :: Array b -> Array a -> (Ptr AFArray -> AFArray -> AFArray -> IO AFErr) - -> Array a + -> Array c {-# NOINLINE op2 #-} op2 (Array fptr1) (Array fptr2) op = unsafePerformIO $ do diff --git a/test/Main.hs b/test/Main.hs index 34ce34d..c949527 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -20,6 +20,7 @@ instance (A.AFType a, Arbitrary a) => Arbitrary (Array a) where main :: IO () main = do + A.setBackend A.CPU -- checks (Proxy :: Proxy (A.Array (A.Complex Float))) -- checks (Proxy :: Proxy (A.Array (A.Complex Double))) -- checks (Proxy :: Proxy (A.Array Double))