Skip to content

Commit 4888f00

Browse files
authored
Merge pull request #1277 from Idclip/feature/ax_binary_updates
AX binary updates
2 parents 9271af7 + 7946c6d commit 4888f00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1802
-119
lines changed

.github/workflows/ax.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ jobs:
8383
-j ${{ matrix.config.j }}
8484
--build-type=${{ matrix.config.build }}
8585
--components=${{ matrix.config.components }}
86-
--cargs=\"-DOPENVDB_CXX_STRICT=ON -DUSE_EXPLICIT_INSTANTIATION=OFF\"
86+
--cargs=\"
87+
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
88+
-DUSE_EXPLICIT_INSTANTIATION=OFF
89+
-DOPENVDB_CXX_STRICT=ON
90+
\"
8791
- name: clean
8892
if: matrix.config.components == 'core'
8993
run: rm -rf build
@@ -94,7 +98,11 @@ jobs:
9498
-j ${{ matrix.config.j }}
9599
--build-type=${{ matrix.config.build }}
96100
--components="axcore,axbin,axtest"
97-
--cargs=\"-DOPENVDB_CXX_STRICT=ON -DUSE_EXPLICIT_INSTANTIATION=OFF\"
101+
--cargs=\"
102+
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
103+
-DUSE_EXPLICIT_INSTANTIATION=OFF
104+
-DOPENVDB_CXX_STRICT=ON
105+
\"
98106
- name: test
99107
run: cd build && ctest -V
100108
- name: test_doxygen_examples
@@ -133,7 +141,11 @@ jobs:
133141
./ci/build.sh -v
134142
--build-type=${{ matrix.config.build }}
135143
--components="core,axcore,axbin,axtest"
136-
--cargs=\"-DLLVM_DIR=/usr/local/opt/llvm@${{ matrix.config.llvm }}/lib/cmake/llvm -DUSE_EXPLICIT_INSTANTIATION=OFF\"
144+
--cargs=\"
145+
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
146+
-DUSE_EXPLICIT_INSTANTIATION=OFF
147+
-DLLVM_DIR=/usr/local/opt/llvm@${{ matrix.config.llvm }}/lib/cmake/llvm
148+
\"
137149
- name: test
138150
run: cd build && ctest -V
139151
- name: test_doxygen_examples

.github/workflows/weekly.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,11 @@ jobs:
352352
-j ${{ matrix.config.j }}
353353
--build-type=${{ matrix.config.build }}
354354
--components=${{ matrix.config.components }}
355-
--cargs=\"-DUSE_EXPLICIT_INSTANTIATION=OFF -DOPENVDB_CXX_STRICT=ON\"
355+
--cargs=\"
356+
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
357+
-DUSE_EXPLICIT_INSTANTIATION=OFF
358+
-DOPENVDB_CXX_STRICT=ON
359+
\"
356360
- name: clean
357361
if: matrix.config.components == 'core'
358362
run: rm -rf build
@@ -363,7 +367,11 @@ jobs:
363367
-j ${{ matrix.config.j }}
364368
--build-type=${{ matrix.config.build }}
365369
--components="axcore,axbin,axtest"
366-
--cargs=\"-DUSE_EXPLICIT_INSTANTIATION=OFF -DOPENVDB_CXX_STRICT=ON\"
370+
--cargs=\"
371+
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
372+
-DUSE_EXPLICIT_INSTANTIATION=OFF
373+
-DOPENVDB_CXX_STRICT=ON
374+
\"
367375
- name: test
368376
run: cd build && ctest -V
369377
- name: test_doxygen_examples
@@ -394,7 +402,11 @@ jobs:
394402
./ci/build.sh -v
395403
--build-type=${{ matrix.config.build }}
396404
--components="core,axcore,axbin,axtest"
397-
--cargs=\"-DUSE_EXPLICIT_INSTANTIATION=OFF -DLLVM_DIR=/usr/local/opt/llvm@${{ matrix.config.llvm }}/lib/cmake/llvm\"
405+
--cargs=\"
406+
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
407+
-DUSE_EXPLICIT_INSTANTIATION=OFF
408+
-DLLVM_DIR=/usr/local/opt/llvm@${{ matrix.config.llvm }}/lib/cmake/llvm
409+
\"
398410
- name: test
399411
run: cd build && ctest -V
400412
- name: test_doxygen_examples
@@ -445,6 +457,7 @@ jobs:
445457
-A x64 -G \"Visual Studio 16 2019\"
446458
-DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET}
447459
-DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
460+
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
448461
-DUSE_EXPLICIT_INSTANTIATION=OFF
449462
-DLLVM_DIR=${HOME}\llvm_install\lib\cmake\llvm
450463
${{ matrix.config.cmake }}

ci/download_vdb_caches.py

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import sys
5+
import time
6+
import threading
7+
import zipfile
8+
import argparse
9+
10+
try:
11+
from urllib.request import urlretrieve
12+
except ImportError:
13+
from urllib import urlretrieve
14+
15+
parser = argparse.ArgumentParser(description='VDB files to download')
16+
parser.add_argument('--files', '-f', type=str, nargs='+',
17+
help='files to download i.e. bunny.vdb fire.vdb')
18+
args = parser.parse_args()
19+
20+
vdbs = [
21+
'armadillo.vdb',
22+
'boat_points.vdb',
23+
'buddha.vdb',
24+
'bunny.vdb',
25+
'bunny_cloud.vdb',
26+
'bunny_points.vdb',
27+
'crawler.vdb',
28+
'cube.vdb',
29+
'dragon.vdb',
30+
'emu.vdb',
31+
'explosion.vdb',
32+
'fire.vdb',
33+
'icosahedron.vdb',
34+
'iss.vdb',
35+
'smoke1.vdb',
36+
'smoke2.vdb',
37+
'space.vdb',
38+
'sphere.vdb',
39+
'sphere_points.vdb',
40+
'torus.vdb',
41+
'torus_knot.vdb',
42+
'utahteapot.vdb',
43+
'venusstatue.vdb',
44+
'waterfall_points.vdb'
45+
]
46+
47+
if args.files:
48+
vdbs = list(set(vdbs) & set(args.files))
49+
if not vdbs:
50+
raise RuntimeError('No valid VDBs specified for download')
51+
52+
# forma urls in the form:
53+
# 'https://artifacts.aswf.io/io/aswf/openvdb/models/buddha.vdb/1.0.0/buddha.vdb-1.0.0.zip'
54+
55+
vdb_urls = []
56+
for vdb in vdbs:
57+
url = 'https://artifacts.aswf.io/io/aswf/openvdb/models/' + \
58+
vdb +'/1.0.0/' + vdb + '-1.0.0.zip'
59+
vdb_urls.append(url)
60+
61+
62+
def download(link, filelocation):
63+
urlretrieve(link, filelocation)
64+
65+
# Init downloads
66+
67+
downloads = dict()
68+
69+
for url in vdb_urls:
70+
zip_filename = os.path.basename(url)
71+
print('Initiating download "' + url + '"')
72+
download_thread = threading.Thread(target=download, args=(url,zip_filename))
73+
download_thread.start()
74+
downloads[zip_filename] = download_thread
75+
76+
sys.stdout.flush()
77+
78+
# Process files
79+
80+
while downloads:
81+
zip_file = None
82+
while not zip_file:
83+
time.sleep(1)
84+
for file, thread in downloads.items():
85+
if not thread.is_alive():
86+
thread.join()
87+
zip_file = file
88+
break
89+
# Remove the entry
90+
del downloads[zip_file]
91+
92+
try:
93+
# Extract the downloaded zip
94+
print('Extracting "' + zip_file + '"...')
95+
sys.stdout.flush()
96+
with zipfile.ZipFile(zip_file, 'r') as zip_ref:
97+
zip_ref.extractall()
98+
99+
print('Cleaning up "' + zip_file + '"...')
100+
sys.stdout.flush()
101+
if os.path.isfile(zip_file): os.remove(zip_file)
102+
103+
except Exception as e:
104+
print(e)
105+
pass
106+

openvdb_ax/openvdb_ax/ast/PrintTree.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ bool PrintVisitor::visit(const ast::AssignExpression* node)
399399

400400
bool PrintVisitor::visit(const ast::Loop* node)
401401
{
402-
mOs << tokens::loopNameFromToken(node->loopType()) <<" "<< node->nodename() << ": " << '\n';
402+
mOs << tokens::loopNameFromToken(node->loopType()) <<" "<< node->nodename() << ":" << '\n';
403403
return true;
404404
}
405405

@@ -414,8 +414,8 @@ bool PrintVisitor::visit(const ast::Crement* node)
414414
mOs << node->nodename() << ':';
415415
if (node->post()) mOs << " post-";
416416
else mOs << " pre-";
417-
if (node->increment()) mOs << "increment ";
418-
else mOs << "decrement ";
417+
if (node->increment()) mOs << "increment";
418+
else mOs << "decrement";
419419
mOs << '\n';
420420
return true;
421421
}

openvdb_ax/openvdb_ax/ast/Scanners.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "Visitor.h"
88

99
#include <string>
10-
#include <unordered_map>
10+
#include <map>
1111

1212
namespace openvdb {
1313
OPENVDB_USE_VERSION_NAMESPACE
@@ -394,7 +394,11 @@ void catalogueAttributeTokens(const ast::Node& node,
394394

395395
// fill a single map with the access patterns for all attributes
396396
// .first = read, .second = write
397-
std::unordered_map<std::string, std::pair<bool,bool>> accessmap;
397+
// @note use a map rather than an unordered_map to preserve order
398+
// of the output vectors on different platforms (the AX compiler
399+
// doesn't care about the order but it's reasonable to expect
400+
// an attribute has the same index from one platform to the next).
401+
std::map<std::string, std::pair<bool,bool>> accessmap;
398402

399403
auto addAccesses = [&](const std::vector<const ast::Variable*>& vars,
400404
const bool read,

0 commit comments

Comments
 (0)