Skip to content

Commit a93ea49

Browse files
authored
Add a test case for 0D region-backed stores (#666)
1 parent d7ca278 commit a93ea49

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/integration/test_0d_store.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2022 NVIDIA Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
from itertools import product
17+
18+
import pytest
19+
20+
import cunumeric as num
21+
22+
SIZE = 3
23+
24+
25+
def test_0d_region_backed_stores():
26+
arr = num.arange(9).reshape(3, 3)
27+
28+
for i, j in product(range(SIZE), range(SIZE)):
29+
i_ind = num.array(i)
30+
j_ind = num.array(j)
31+
v = arr[i_ind, j_ind]
32+
assert int(v) == i * SIZE + j
33+
34+
35+
if __name__ == "__main__":
36+
import sys
37+
38+
sys.exit(pytest.main(sys.argv))

0 commit comments

Comments
 (0)