Skip to content

Commit

Permalink
gpu: cuda: enable USM tests and update README to say USM is supported
Browse files Browse the repository at this point in the history
  • Loading branch information
t4c1 authored and densamoilov committed Mar 2, 2022
1 parent 8ced056 commit 5d6f198
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 20 deletions.
8 changes: 0 additions & 8 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ if(DNNL_CPU_SYCL)
endforeach()
endif()

# Skip examples for CUDA since USM is a default model for the library which is
# not yet supported for Nvidia backend.
if(DNNL_SYCL_CUDA)
foreach(f ${sources})
list(REMOVE_ITEM sources "${f}")
endforeach()
endif()

foreach(src ${sources})
file(RELATIVE_PATH src_rel_path ${CMAKE_CURRENT_SOURCE_DIR} ${src})
string(REGEX REPLACE "[/_\\.]" "-" example_name ${src_rel_path})
Expand Down
2 changes: 1 addition & 1 deletion src/gpu/nvidia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cmake -DDNNL_CPU_RUNTIME=DPCPP -DDNNL_GPU_RUNTIME=DPCPP \

## Memory

Currently, only the buffer-based oneDNN API is supported for Nvidia backend.
Both buffer-based and USM-based oneDNN APIs are supported for Nvidia backend.

## Suported Data Types

Expand Down
9 changes: 0 additions & 9 deletions tests/benchdnn/dnnl_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,6 @@ int dnn_mem_t::reorder(const dnn_mem_t &rhs, const_dnnl_primitive_attr_t attr) {

int dnn_mem_t::initialize_memory_create_sycl(const handle_info_t &handle_info) {
#ifdef DNNL_WITH_SYCL
if (is_nvidia_gpu(engine_)) {
// USM is not supported with Nvidia so ignore memory_kind and
// force SYCL buffers.
DNN_SAFE(dnnl_sycl_interop_memory_create(&m_, &md_, engine_,
dnnl_sycl_interop_buffer, handle_info.ptr),
CRIT);
return OK;
}

if (handle_info.is_host_ptr) {
// Ignore memory_kind with host pointers and force USM.
DNN_SAFE(dnnl_sycl_interop_memory_create(&m_, &md_, engine_,
Expand Down
3 changes: 1 addition & 2 deletions tests/gtests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ file(GLOB PRIM_TEST_CASES_SRC
test_matmul.cpp
test_resampling.cpp
test_reduction.cpp
test_softmax_v2.cpp
)

if(DNNL_CPU_RUNTIME STREQUAL "NONE")
Expand Down Expand Up @@ -237,7 +236,7 @@ endif()

foreach(TEST_FILE ${PRIM_TEST_CASES_SRC})
get_filename_component(exe ${TEST_FILE} NAME_WE)
if(NOT ${exe} MATCHES "${skip_usm_pattern}" AND NOT DNNL_SYCL_CUDA)
if(NOT ${exe} MATCHES "${skip_usm_pattern}")
register_gtest(${exe} ${TEST_FILE})
endif()

Expand Down

0 comments on commit 5d6f198

Please sign in to comment.