diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25b503025..183030990 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: max-parallel: 20 matrix: # branch: [version-1-0, version-1-2, version-1-4, version-1-6] # [devel] - nim: ['version-1-4', 'version-1-6'] # 'devel' + nim: ['version-1-4', 'version-1-6', 'devel'] # 'devel' target: - os: linux cpu: amd64 @@ -216,6 +216,14 @@ jobs: # Run the tests. nimble test + - name: Run Arraymancer tests with ORC + working-directory: arraymancer + run: | + export ARRAYMANCER_TEST_LANG=${{ matrix.test_lang }} + nimble install -y --depsOnly + # Run the tests. + nimble test_orc_release + - name: Build docs if: > github.event_name == 'push' && github.ref == 'refs/heads/master' && diff --git a/src/arraymancer/io/io_csv.nim b/src/arraymancer/io/io_csv.nim index 6c5a0abde..cebc62b60 100644 --- a/src/arraymancer/io/io_csv.nim +++ b/src/arraymancer/io/io_csv.nim @@ -84,7 +84,11 @@ proc read_csv*[T: SomeNumber|bool|string]( elif T is bool: parser = parseBool elif T is string: - parser = proc(x: string): string = shallowCopy(result, x) # no-op + parser = proc(x: string): string = + when defined(gcArc) or defined(gcOrc): + result = x + else: + shallowCopy(result, x) # no-op # 1. count number of lines and columns using memfile interface let (numRows, numCols) = countLinesAndCols(csvPath, separator, quote, skipHeader) diff --git a/src/arraymancer/linear_algebra/helpers/decomposition_lapack.nim b/src/arraymancer/linear_algebra/helpers/decomposition_lapack.nim index 2b96698ec..c9cfa43f1 100644 --- a/src/arraymancer/linear_algebra/helpers/decomposition_lapack.nim +++ b/src/arraymancer/linear_algebra/helpers/decomposition_lapack.nim @@ -69,7 +69,7 @@ proc syevr*[T: SomeFloat](a: var Tensor[T], uplo: static char, return_eigenvecto lwork: int32 = -1 # dimension of a workspace array work_size: T liwork: int32 = -1 # dimension of a second workspace array - iwork: seq[cint] + iwork: seq[int32] iwork_size: int32 info: int32 @@ -84,7 +84,7 @@ proc syevr*[T: SomeFloat](a: var Tensor[T], uplo: static char, return_eigenvecto # Setting up output var - isuppz: seq[cint] # unused + isuppz: seq[int32] # unused isuppz_ptr: ptr int32 eigenval = newTensorUninit[T](a.shape[0]) # Even if less eigenval are selected Lapack requires this much workspace @@ -246,7 +246,7 @@ proc gesdd*[T: SomeFloat](a: var Tensor[T], U, S, Vh: var Tensor[T], scratchspac work_size: T lwork = -1'i32 # size query info: int32 - iwork = newSeqUninit[cint](8 * k) + iwork = newSeqUninit[int32](8 * k) U.newMatrixUninitColMajor(ldu, ucol) S = newTensorUninit[T](k.int) diff --git a/src/arraymancer/linear_algebra/helpers/least_squares_lapack.nim b/src/arraymancer/linear_algebra/helpers/least_squares_lapack.nim index ba1bb5f44..4d03efa56 100644 --- a/src/arraymancer/linear_algebra/helpers/least_squares_lapack.nim +++ b/src/arraymancer/linear_algebra/helpers/least_squares_lapack.nim @@ -77,7 +77,7 @@ proc gelsd*[T: SomeFloat]( singular_values = newTensorUninit[T](minmn) # will hold the singular values of A var # Temporary parameter values - iwork = newSeqUninit[cint](liwork) + iwork = newSeqUninit[int32](liwork) info, rank: int32 lwork: int32 = -1 diff --git a/src/arraymancer/tensor/higher_order_foldreduce.nim b/src/arraymancer/tensor/higher_order_foldreduce.nim index 74db725c5..b6dbd96ce 100644 --- a/src/arraymancer/tensor/higher_order_foldreduce.nim +++ b/src/arraymancer/tensor/higher_order_foldreduce.nim @@ -125,7 +125,10 @@ proc reduce*[T](t: Tensor[T], ## a.reduce(max) ## This returns the maximum value in the Tensor. t.reduce_inline(): - shallowCopy(x, f(x,y)) + when defined(gcArc) or defined(gcOrc): + x = f(x,y) # hopefully nvro will work + else: + shallowCopy(x, f(x,y)) proc reduce*[T](t: Tensor[T], f: (Tensor[T], Tensor[T]) -> Tensor[T], @@ -142,4 +145,7 @@ proc reduce*[T](t: Tensor[T], ## - A tensor aggregate of the function called all elements of the tensor t.reduce_axis_inline(axis): - shallowCopy(x, f(x,y)) + when defined(gcArc) or defined(gcOrc): + x = f(x,y) # hopefully nvro will work + else: + shallowCopy(x, f(x,y)) diff --git a/tests/tensor/test_init.nim b/tests/tensor/test_init.nim index 79208b1c9..9fb8f07c4 100644 --- a/tests/tensor/test_init.nim +++ b/tests/tensor/test_init.nim @@ -183,8 +183,8 @@ proc main() = var t: TestObject t.x = @[1.0, 2, 3, 4].toTensor() t.x = t.x - doAssert t.x.storage.isNil, "If you see this message, bug Nim #16185 is fixed." & - " Remove this test or set it to `not t.x.isNil`!" + when (NimMajor, NimMinor) >= (1, 6): # works since 1.6; see https://github.com/nim-lang/Nim/issues/16185 + doAssert not t.x.storage.isNil test "Init tensor from raw buffer": let size = 100