Skip to content

Commit

Permalink
Merge branch 'ccrouzet/fix-implicit-init' into 'main'
Browse files Browse the repository at this point in the history
Fix Array Constructors Not Initializing Warp

See merge request omniverse/warp!565
  • Loading branch information
christophercrouzet committed Jun 13, 2024
2 parents 3bb42dd + d9f4389 commit cff9f2c
Show file tree
Hide file tree
Showing 5 changed files with 396 additions and 16 deletions.
22 changes: 22 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,28 @@ windows-x86_64 test mgpu:
- os/windows
- gpu/2x-A5000


linux-x86_64 test warp-init:
stage: test
needs: [linux-x86_64 build]
extends:
- .omni_nvks_gpu
- .save_test_report_artifact
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- df -h
# Move compiled binaries out of platform-specific directory
- mv warp/bin/linux-x86_64/warp.so warp/bin/
- mv warp/bin/linux-x86_64/warp-clang.so warp/bin/
- tools/packman/packman install -l _build/target-deps/python python ${DEFAULT_PYTHON}-linux-x86_64
- $PYTHON -m venv _venv
- source _venv/bin/activate
- python -m pip install --upgrade pip
- python -m pip install -e .
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- python -m warp.tests --junit-report-xml rspec.xml -s autodetect --disable-process-pooling --disable-concurrent-futures --level test -p 'test_implicit_init.py'

# The only purpose of this job is to make sure documentation can be built on Windows.
# The output does not get published anywhere, but the website can be viewed in the
# artifacts.
Expand Down
5 changes: 4 additions & 1 deletion warp/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def __repr__(self):
def call_builtin(func: Function, *params) -> Tuple[bool, Any]:
uses_non_warp_array_type = False

warp.context.init()
init()

# Retrieve the built-in function from Warp's dll.
c_func = getattr(warp.context.runtime.core, func.mangled_name)
Expand Down Expand Up @@ -3632,6 +3632,9 @@ def is_mempool_access_supported(target_device: Devicelike, peer_device: Deviceli

init()

target_device = runtime.get_device(target_device)
peer_device = runtime.get_device(peer_device)

return target_device.is_mempool_supported and is_peer_access_supported(target_device, peer_device)


Expand Down
Loading

0 comments on commit cff9f2c

Please sign in to comment.