Skip to content

Commit

Permalink
gpu: ocl: remove unused offset_t for ref_eltwise
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoursler authored and vpirogov committed May 12, 2023
1 parent be05c33 commit 1932b3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
18 changes: 7 additions & 11 deletions src/gpu/ocl/ref_eltwise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ namespace impl {
namespace gpu {
namespace ocl {

static status_t init_conf_common(eltwise_conf_t &conf, offsets_t &off,
const eltwise_pd_t *pd, engine_t *engine) {
static status_t init_conf_common(
eltwise_conf_t &conf, const eltwise_pd_t *pd, engine_t *engine) {
alg_kind_t alg = pd->desc()->alg_kind;
const bool is_forward = pd->is_fwd();
const auto &src_md = pd->use_dst() ? pd->dst_md() : pd->src_md();
Expand All @@ -42,9 +42,6 @@ static status_t init_conf_common(eltwise_conf_t &conf, offsets_t &off,
conf.is_forward = is_forward;
conf.attr_info = attr_info_t::create(pd->attr());

set_offsets(src_d, off.src_off);
set_offsets(diff_data_d, off.dst_off);

const auto &dims = src_d.padded_dims();

conf.with_zero_padding = src_d.nelems(false) != src_d.nelems(true);
Expand All @@ -65,8 +62,7 @@ static status_t init_conf_common(eltwise_conf_t &conf, offsets_t &off,
}

static status_t init_kernel_ctx_common(compute::kernel_ctx_t &kernel_ctx,
const eltwise_conf_t &conf, const offsets_t &off,
const post_ops_t &post_ops) {
const eltwise_conf_t &conf, const post_ops_t &post_ops) {
kernel_ctx.set_data_type(conf.data_type);

def_eltwise_alg_kinds(kernel_ctx);
Expand Down Expand Up @@ -98,12 +94,12 @@ static status_t init_kernel_ctx_common(compute::kernel_ctx_t &kernel_ctx,
}

status_t ref_eltwise_fwd_t::pd_t::init_conf(engine_t *engine) {
return init_conf_common(conf, off, this, engine);
return init_conf_common(conf, this, engine);
}

status_t ref_eltwise_fwd_t::pd_t::init_kernel_ctx(
compute::kernel_ctx_t &kernel_ctx) const {
return init_kernel_ctx_common(kernel_ctx, conf, off, attr()->post_ops_);
return init_kernel_ctx_common(kernel_ctx, conf, attr()->post_ops_);
}

status_t ref_eltwise_fwd_t::execute_forward_dense(const exec_ctx_t &ctx) const {
Expand All @@ -129,12 +125,12 @@ status_t ref_eltwise_fwd_t::execute_forward_dense(const exec_ctx_t &ctx) const {
}

status_t ref_eltwise_bwd_t::pd_t::init_conf(engine_t *engine) {
return init_conf_common(conf, off, this, engine);
return init_conf_common(conf, this, engine);
}

status_t ref_eltwise_bwd_t::pd_t::init_kernel_ctx(
compute::kernel_ctx_t &kernel_ctx) const {
return init_kernel_ctx_common(kernel_ctx, conf, off, attr()->post_ops_);
return init_kernel_ctx_common(kernel_ctx, conf, attr()->post_ops_);
}

status_t ref_eltwise_bwd_t::execute_backward_dense(
Expand Down
2 changes: 0 additions & 2 deletions src/gpu/ocl/ref_eltwise.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ struct ref_eltwise_fwd_t : public gpu_primitive_t {
status_t init_kernel_ctx(compute::kernel_ctx_t &kernel_ctx) const;

eltwise_conf_t conf;
offsets_t off;
};

status_t init(engine_t *engine) override {
Expand Down Expand Up @@ -129,7 +128,6 @@ struct ref_eltwise_bwd_t : public gpu_primitive_t {
status_t init_kernel_ctx(compute::kernel_ctx_t &kernel_ctx) const;

eltwise_conf_t conf;
offsets_t off;
bool use_dense;
};

Expand Down

0 comments on commit 1932b3d

Please sign in to comment.