Skip to content

Commit ec4afae

Browse files
authored
[SYCLomatic] Add a test case for peer access API migration (#564)
Signed-off-by: Wang, Hao3 <[email protected]>
1 parent 1ef05eb commit ec4afae

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<test driverID="test_feature" name="TEMPLATE">
4+
<description>test</description>
5+
<files>
6+
<file path="feature_case/peer_access/${testName}.cu" />
7+
</files>
8+
<rules />
9+
</test>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <cuda_runtime.h>
2+
#include <iostream>
3+
4+
int main() {
5+
int cur_device;
6+
cudaGetDevice(&cur_device);
7+
8+
int can_access = 0;
9+
cudaDeviceCanAccessPeer(&can_access, cur_device, cur_device);
10+
cudaDeviceDisablePeerAccess(cur_device);
11+
cudaDeviceEnablePeerAccess(cur_device, 0);
12+
13+
std::cout << "test passed" << std::endl;
14+
15+
return 0;
16+
}

features/features.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@
317317
<test testName="remove_unnecessary_wait" configFile="config/TEMPLATE_remove_unnecessary_wait.xml" />
318318
<test testName="warp_reduce_functions" configFile="config/TEMPLATE_cpp_language_extensions.xml" />
319319
<!-- <test testName="wmma" configFile="config/TEMPLATE_wmma.xml" /> -->
320+
<test testName="peer_access" configFile="config/TEMPLATE_peer_access.xml" />
320321
<test testName="const_opt" configFile="config/TEMPLATE_const_opt.xml" />
321322
</tests>
322323
</suite>

features/test_feature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
'math-bfloat16', 'libcu_atomic', 'test_shared_memory', 'cudnn-reduction', 'cudnn-binary', 'cudnn-bnp1', 'cudnn-bnp2', 'cudnn-bnp3',
4040
'cudnn-normp1', 'cudnn-normp2', 'cudnn-normp3', 'cudnn-convp1', 'cudnn-convp2', 'cudnn-convp3', 'cudnn-convp4', 'cudnn-convp5', 'cudnn-convp6', 'cudnn-convp7',
4141
'cudnn_mutilple_files', "cusparse_1", "cusparse_2", "cusparse_3", "cusparse_4", "cusparse_5", "cusparse_6", "cusparse_7", "cusparse_8",
42-
'cudnn-GetErrorString', 'cub_device_histgram',
42+
'cudnn-GetErrorString', 'cub_device_histgram', 'peer_access',
4343
'cudnn-types', 'cudnn-version', 'cudnn-dropout', 'const_opt',
4444
'constant_attr', 'sync_warp_p2', 'occupancy_calculation',
4545
'text_obj_array', 'text_obj_linear', 'text_obj_pitch2d', 'match',

0 commit comments

Comments
 (0)