Skip to content

Commit 8d25117

Browse files
committed
add test private
1 parent 7e60d56 commit 8d25117

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test_private/test_private.cpp

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <hc.hpp>
2+
3+
int main() {
4+
5+
hc::array_view<int,1> s(1);
6+
hc::array_view<int,1> ab(1);
7+
8+
int d = 100;
9+
10+
hc::parallel_for_each(s.get_extent(),[&,s,ab,d](hc::index<1> i) [[hc]] {
11+
int b = i[0] + *(&d);
12+
ab[i] = b;
13+
s[i] = sizeof(&b);
14+
});
15+
16+
printf("sizeof private: %d\n",s[0]);
17+
printf("ab[0]: %d\n",ab[0]);
18+
19+
return 0;
20+
}

0 commit comments

Comments
 (0)