Skip to content

Commit

Permalink
gpu: ocl: remove duplicate KERNEL_ATTR declaration
Browse files Browse the repository at this point in the history
Duplicate declarations do nothing in the C preprocessor
  • Loading branch information
rjoursler authored and vpirogov committed Apr 5, 2023
1 parent a18c19e commit f5654f5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
4 changes: 1 addition & 3 deletions src/gpu/ocl/ref_eltwise.cl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2021 Intel Corporation
* Copyright 2019-2023 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,8 +23,6 @@
#define DIFF_DATA_OFF(x0, x1, x2, x3, x4, x5) \
OFF_MD(DIFF_DATA, x0, x1, x2, x3, x4, x5)

#define KERNEL_ATTR __attribute__((intel_reqd_sub_group_size(SUB_GROUP_SIZE)))

#if IS_FWD
KERNEL_ATTR
__kernel void ref_eltwise_fwd(__global DATA_T *src, __global DATA_T *dst,
Expand Down
2 changes: 0 additions & 2 deletions src/gpu/ocl/ref_eltwise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ static status_t init_conf_common(eltwise_conf_t &conf, offsets_t &off,
conf.alg = alg;
conf.is_forward = is_forward;
conf.attr_info = attr_info_t::create(pd->attr());
conf.sub_group_size = 32;

set_offsets(src_d, off.src_off);
set_offsets(diff_data_d, off.dst_off);
Expand Down Expand Up @@ -78,7 +77,6 @@ static status_t init_kernel_ctx_common(compute::kernel_ctx_t &kernel_ctx,
kernel_ctx.define_int("GWS0", conf.dispatch.nd_range().global_range()[0]);
kernel_ctx.define_int("GWS1", conf.dispatch.nd_range().global_range()[1]);
kernel_ctx.define_int("GWS2", conf.dispatch.nd_range().global_range()[2]);
kernel_ctx.define_int("SUB_GROUP_SIZE", conf.sub_group_size);

bool with_binary_post_ops
= post_ops.find(primitive_kind_t::dnnl_binary) != -1;
Expand Down
7 changes: 0 additions & 7 deletions src/gpu/ocl/ref_eltwise.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ struct ref_eltwise_fwd_t : public gpu_primitive_t {
if (!ok) return status::unimplemented;

CHECK(init_conf(engine));
if (!compute_engine->mayiuse_sub_group(conf.sub_group_size))
return status::unimplemented;
return status::success;
}

Expand Down Expand Up @@ -110,9 +108,6 @@ struct ref_eltwise_bwd_t : public gpu_primitive_t {
using namespace utils;
assert(engine->kind() == engine_kind::gpu);

auto *compute_engine
= utils::downcast<compute::compute_engine_t *>(engine);

using namespace alg_kind;
const bool ok = !is_fwd()
&& !memory_desc_ndims_ok(data_md(), diff_dst_md())
Expand All @@ -127,8 +122,6 @@ struct ref_eltwise_bwd_t : public gpu_primitive_t {
if (!ok) return status::unimplemented;

CHECK(init_conf(engine));
if (!compute_engine->mayiuse_sub_group(conf.sub_group_size))
return status::unimplemented;
return status::success;
}

Expand Down

0 comments on commit f5654f5

Please sign in to comment.