Skip to content

Commit fe7346e

Browse files
authored
[SYCLomatic #755] Add test for migration of cudaCpuDeviceId in cudaMemPrefetchAsync (#275)
Signed-off-by: chenwei.sun <[email protected]>
1 parent 87e850e commit fe7346e

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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/deviceAPI/${testName}.cu" />
7+
</files>
8+
<rules>
9+
<optlevelRule excludeOptlevelNameString="usmnone" />
10+
</rules>
11+
</test>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// ====------ device_cpu.cu---------------- *- CUDA -* ----===////
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//
8+
// ===---------------------------------------------------------===//
9+
10+
void bar(const void *devPtr, int size) {
11+
cudaMemAdvise(devPtr, size, cudaMemAdviseSetPreferredLocation,
12+
cudaCpuDeviceId);
13+
}
14+
15+
int main() {
16+
int *devPtr;
17+
bar(devPtr, 100);
18+
return 0;
19+
}

features/features.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@
365365
<test testName="free-queries" configFile="config/TEMPLATE_freeQueries.xml" />
366366
<test testName="deviceProp" configFile="config/TEMPLATE_deviceProp.xml" />
367367
<test testName="gridThreads" configFile="config/TEMPLATE_gridThreads.xml" />
368+
<test testName="device_cpu" configFile="config/TEMPLATE_device_cpu.xml" />
368369
<test testName="kernel_library" configFile="config/TEMPLATE_kernel_library.xml" />
369370
<test testName="BlasUtils_api_test11" configFile="config/TEMPLATE_custom_helper_files_BlasUtils.xml" />
370371
<test testName="BlasUtils_api_test12" configFile="config/TEMPLATE_custom_helper_files_BlasUtils.xml" />

0 commit comments

Comments
 (0)