Skip to content

Commit 09c7170

Browse files
authored
gpu: nvidia: amd: generic: ignore check-ref-impl (#2427)
1 parent 64cc1c9 commit 09c7170

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

tests/benchdnn/dnnl_common.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,10 @@ int check_same_pd(const dnnl_primitive_desc_t &pd_no_attr, res_t *res) {
864864
int check_ref_impl_hit(res_t *res) {
865865
if (!check_ref_impl) return OK;
866866

867+
// Nvidia, AMD and Generic backends use reference implementations to fill
868+
// gaps in feature support.
869+
if (is_nvidia_gpu() || is_amd_gpu() || is_generic_gpu()) return OK;
870+
867871
const auto &impl_name = res->impl_name;
868872
if (impl_name.find("ref") != std::string::npos) {
869873
res->state = FAILED;
@@ -918,6 +922,14 @@ bool is_amd_gpu(const dnnl_engine_t &engine) {
918922
return false;
919923
}
920924

925+
bool is_generic_gpu(const dnnl_engine_t &engine) {
926+
#if defined(DNNL_WITH_SYCL) && DNNL_GPU_VENDOR == DNNL_VENDOR_GENERIC
927+
return is_gpu(engine);
928+
#endif
929+
930+
return false;
931+
}
932+
921933
bool is_f64_supported(const dnnl_engine_t &engine) {
922934
if (!is_gpu(engine)) return false;
923935
if (is_nvidia_gpu(engine) || is_amd_gpu(engine)) return false;

tests/benchdnn/dnnl_common.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ bool is_opencl_engine(const dnnl_engine_t &engine = get_test_engine());
146146
bool is_nvidia_gpu(const dnnl_engine_t &engine = get_test_engine());
147147
bool is_f64_supported(const dnnl_engine_t &engine = get_test_engine());
148148
bool is_amd_gpu(const dnnl_engine_t &engine = get_test_engine());
149+
bool is_generic_gpu(const dnnl_engine_t &engine = get_test_engine());
149150

150151
// Extended version of dnnl_sycl_interop_memory_kind_t enumeration.
151152
enum class memory_kind_ext_t {

tests/benchdnn/doc/knobs_common.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ changes the implementation dispatching which is an undesired behavior. When
168168
string against the `ref` string pattern. When `BOOL` is set to `true`, the check
169169
returns an error if the name matches the reference pattern. By default, the
170170
check is disabled. It's useful to catch unexpected fallbacks to slow reference
171-
implementations from a big batch of problems.
171+
implementations from a big batch of problems. This option is always disabled on
172+
NVIDIA, AMD, and Generic vendors.
172173

173174
### --fast-ref
174175
`--fast-ref=BOOL` instructs the driver to use an optimized implementation

0 commit comments

Comments
 (0)