Skip to content

Commit

Permalink
Test Valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Mar 13, 2024
1 parent 02d79a9 commit c5a34a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ jobs:
include:
- ruby: 3.3
os: ubuntu-22.04
- ruby: 3.2
os: ubuntu-22.04
- ruby: 3.1
os: ubuntu-20.04
- ruby: "3.0"
os: ubuntu-20.04
env:
LIBTORCH_VERSION: 2.2.1
steps:
Expand All @@ -35,4 +29,5 @@ jobs:
wget -q -O libtorch.zip https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-$LIBTORCH_VERSION%2Bcpu.zip
unzip -q libtorch.zip
- run: MAKE="make -j$(nproc)" bundle exec rake compile -- --with-torch-dir=$HOME/libtorch
- run: bundle exec rake test
- run: sudo apt-get update && sudo apt-get install valgrind
- run: bundle exec rake test:valgrind
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gem "rake"
gem "rake-compiler"
gem "minitest", ">= 5"
gem "numo-narray"
gem "ruby_memcheck"

# for examples
gem "torchvision", ">= 0.2", require: false
8 changes: 7 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
require "bundler/gem_tasks"
require "rake/testtask"
require "rake/extensiontask"
require "ruby_memcheck"

task default: :test
Rake::TestTask.new do |t|
test_config = lambda do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
end
Rake::TestTask.new(:test, &test_config)

namespace :test do
RubyMemcheck::TestTask.new(:valgrind, &test_config)
end

Rake::ExtensionTask.new("torch") do |ext|
ext.name = "ext"
Expand Down

0 comments on commit c5a34a4

Please sign in to comment.