Skip to content
Merged
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
11 changes: 5 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ on: [push, pull_request]
jobs:
MRI:
name: ${{ matrix.os }} ruby-${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-11, windows-2022]
ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', head]
include:
- { os: windows-2022 , ruby: mswin }
os: ['ubuntu', 'macos', 'windows']
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', head]
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby }}
Expand Down Expand Up @@ -59,7 +57,7 @@ jobs:
sudo apt-get -y install podman
podman pull fedora:rawhide
- name: Get source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: 'numo-narray'
- name: Create container and run tests
Expand All @@ -75,6 +73,7 @@ jobs:
echo 'RUN gem build numo-narray.gemspec'
echo 'RUN gem install numo-narray-*.gem'
echo 'RUN bundle install'
echo 'RUN bundle exec rake compile'
echo 'RUN bundle exec rake test'
} > podmanfile
podman build --tag fedora_test -f ./podmanfile
2 changes: 1 addition & 1 deletion ext/numo/narray/ndloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef struct NA_MD_LOOP {
VALUE reduce;
VALUE loop_opt;
ndfunc_t *ndfunc;
void (*loop_func)();
void (*loop_func)(ndfunc_t *, struct NA_MD_LOOP *);
} na_md_loop_t;

#define LARG(lp,iarg) ((lp)->user.args[iarg])
Expand Down
5 changes: 3 additions & 2 deletions ext/numo/narray/numo/types/xint_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

#define m_extract(x) m_data_to_num(*(dtype*)(x))

#define m_from_double(x) (x)
#define m_from_real(x) (x)
/* Handle negative values consistently across platforms for unsigned integer types */
#define m_from_double(x) ((x) < 0 ? (dtype)((long long)(x)) : (dtype)(x))
#define m_from_real(x) ((x) < 0 ? (dtype)((long long)(x)) : (dtype)(x))
#define m_from_sint(x) (x)
#define m_from_int32(x) (x)
#define m_from_int64(x) (x)
Expand Down
6 changes: 3 additions & 3 deletions test/narray_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ class NArrayTest < Test::Unit::TestCase
assert { a.sum == 29 }
if float_types.include?(dtype)
assert { a.mean == 29.0/6 }
assert { a.var == 13.766666666666669 }
assert { a.stddev == 3.710345895825168 }
assert { a.rms == 5.901977069875258 }
assert_in_delta(a.var, 13.766666666666669, 1e-14)
assert_in_delta(a.stddev, 3.710345895825168, 1e-14)
assert_in_delta(a.rms, 5.901977069875258, 1e-14)
end
assert { a.dup.fill(12) == [12]*6 }
assert { (a + 1) == [2,3,4,6,8,12] }
Expand Down