Skip to content

Commit

Permalink
xe: rnn: adhere to class name style
Browse files Browse the repository at this point in the history
  • Loading branch information
atkassen committed Jan 26, 2025
1 parent dca0f27 commit 6b90d64
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions src/gpu/intel/ocl/rnn/cell_common.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2024 Intel Corporation
* Copyright 2019-2025 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 Down Expand Up @@ -120,7 +120,7 @@ status_t compute_cell_fwd(const exec_ctx_t &ctx,
}

template <prop_kind_t aprop>
cell_execution_sig((_simple_rnn_common_t<aprop>::cell_execution)) {
cell_execution_sig((simple_rnn_common_t<aprop>::cell_execution)) {
const conf_t &rnn = this->pd()->rnn_conf;
const ocl_conf_t &ocl_conf = this->pd()->ocl_conf;
const rnn_offsets_t &offsets = this->pd()->off;
Expand Down
4 changes: 2 additions & 2 deletions src/gpu/intel/ocl/rnn/cell_gru.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2024 Intel Corporation
* Copyright 2019-2025 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 Down Expand Up @@ -28,7 +28,7 @@ using namespace dnnl::impl::utils;
using namespace rnn_utils;

template <prop_kind_t aprop>
cell_execution_sig((_simple_rnn_common_t<aprop>::cell_execution_gru)) {
cell_execution_sig((simple_rnn_common_t<aprop>::cell_execution_gru)) {
const conf_t &rnn = this->pd()->rnn_conf;
const ocl_conf_t &ocl_conf = this->pd()->ocl_conf;
const rnn_offsets_t &offsets = this->pd()->off;
Expand Down
4 changes: 2 additions & 2 deletions src/gpu/intel/ocl/rnn/cell_gru_lbr.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2024 Intel Corporation
* Copyright 2019-2025 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 Down Expand Up @@ -33,7 +33,7 @@ template cell_execution_sig(simple_rnn_fwd_t::cell_execution_gru_lbr);
template cell_execution_sig(simple_rnn_bwd_t::cell_execution_gru_lbr);

template <prop_kind_t aprop>
cell_execution_sig((_simple_rnn_common_t<aprop>::cell_execution_gru_lbr)) {
cell_execution_sig((simple_rnn_common_t<aprop>::cell_execution_gru_lbr)) {
const conf_t &rnn = this->pd()->rnn_conf;
const ocl_conf_t &ocl_conf = this->pd()->ocl_conf;
const rnn_offsets_t &offsets = this->pd()->off;
Expand Down
32 changes: 16 additions & 16 deletions src/gpu/intel/ocl/rnn/rnn_grid.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2024 Intel Corporation
* Copyright 2019-2025 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 Down Expand Up @@ -461,7 +461,7 @@ status_t ocl_conf_t::init_kernel_ctx(compute::kernel_ctx_t &kernel_ctx) const {
}

template <>
status_t _simple_rnn_common_t<prop_kind::forward>::pd_t::set_default_params() {
status_t simple_rnn_common_t<prop_kind::forward>::pd_t::set_default_params() {
using namespace format_tag;
if (src_layer_md_.format_kind == format_kind::any)
CHECK(memory_desc_init_by_tag(src_layer_md_, tnc));
Expand Down Expand Up @@ -489,7 +489,7 @@ status_t _simple_rnn_common_t<prop_kind::forward>::pd_t::set_default_params() {
}

template <>
status_t _simple_rnn_common_t<prop_kind::backward>::pd_t::set_default_params() {
status_t simple_rnn_common_t<prop_kind::backward>::pd_t::set_default_params() {
using namespace format_tag;
int arch_ld = is_xe_hpc ? 128 : 64;
if (src_layer_md_.format_kind == format_kind::any)
Expand Down Expand Up @@ -564,7 +564,7 @@ status_t _simple_rnn_common_t<prop_kind::backward>::pd_t::set_default_params() {
}

template <prop_kind_t aprop>
status_t _simple_rnn_common_t<aprop>::pd_t::init(impl::engine_t *engine) {
status_t simple_rnn_common_t<aprop>::pd_t::init(impl::engine_t *engine) {
using namespace prop_kind;
using namespace utils;
using namespace rnn_utils;
Expand Down Expand Up @@ -948,7 +948,7 @@ status_t _simple_rnn_common_t<aprop>::pd_t::init(impl::engine_t *engine) {
}

template <prop_kind_t aprop>
status_t _simple_rnn_common_t<aprop>::init(impl::engine_t *engine) {
status_t simple_rnn_common_t<aprop>::init(impl::engine_t *engine) {
using namespace rnn_utils;

switch (pd()->cell_kind()) {
Expand Down Expand Up @@ -1043,7 +1043,7 @@ status_t _simple_rnn_common_t<aprop>::init(impl::engine_t *engine) {
}

template <prop_kind_t aprop>
status_t _simple_rnn_common_t<aprop>::init_res_storage(
status_t simple_rnn_common_t<aprop>::init_res_storage(
impl::engine_t *engine, gpu_resource_t *r) const {
if (pd()->rnn_conf.is_int8 && pd()->rnn_conf.copy_bias) {
dim_t size = pd()->rnn_conf.n_gates * pd()->rnn_conf.dhc
Expand Down Expand Up @@ -1086,7 +1086,7 @@ status_t _simple_rnn_common_t<aprop>::init_res_storage(
}

template <prop_kind_t aprop>
gemm_sig((_simple_rnn_common_t<aprop>::gemm_primitive)) {
gemm_sig((simple_rnn_common_t<aprop>::gemm_primitive)) {
// We flip A and B here since the GEMM API is row major but the
// RNN code describes GEMM in column major fashion
gemm_exec_args_t gemm_args;
Expand Down Expand Up @@ -1171,7 +1171,7 @@ gemm_sig((_simple_rnn_common_t<aprop>::gemm_primitive)) {

//*************** Grid computations strategy: linear ***************//
template <prop_kind_t aprop>
grid_execution_sig((_simple_rnn_common_t<aprop>::linear_execution)) {
grid_execution_sig((simple_rnn_common_t<aprop>::linear_execution)) {
const conf_t &rnn = pd()->rnn_conf;
dim_t n_layer = rnn.n_layer;
dim_t n_dir = rnn.n_dir;
Expand Down Expand Up @@ -1257,7 +1257,7 @@ grid_execution_sig((_simple_rnn_common_t<aprop>::linear_execution)) {
//********* GRID computations strategy: utility functions **********//

template <prop_kind_t aprop>
status_t _simple_rnn_common_t<aprop>::bias_prepare(const exec_ctx_t &ctx,
status_t simple_rnn_common_t<aprop>::bias_prepare(const exec_ctx_t &ctx,
compute::compute_stream_t *compute_stream, dim_t n_layer, dim_t n_dir,
dim_t n_bias, dim_t n_gates, dim_t dhc, const memory_storage_t &ws_bias,
const memory_storage_t &scales, const memory_storage_t &wei_layer,
Expand Down Expand Up @@ -1289,7 +1289,7 @@ status_t _simple_rnn_common_t<aprop>::bias_prepare(const exec_ctx_t &ctx,
}

template <prop_kind_t aprop>
status_t _simple_rnn_common_t<aprop>::copy_init_layer(const exec_ctx_t &ctx,
status_t simple_rnn_common_t<aprop>::copy_init_layer(const exec_ctx_t &ctx,
compute::compute_stream_t *compute_stream, bool lr, bool rl,
dim_t batch, dim_t dhc, dim_t slc, dim_t n_iter, dim_t n_layer,
dim_t n_dir, dim_t n_states, dim_t states_ws_ld,
Expand Down Expand Up @@ -1348,7 +1348,7 @@ status_t _simple_rnn_common_t<aprop>::copy_init_layer(const exec_ctx_t &ctx,
}

template <prop_kind_t aprop>
status_t _simple_rnn_common_t<aprop>::copy_init_iter(const exec_ctx_t &ctx,
status_t simple_rnn_common_t<aprop>::copy_init_iter(const exec_ctx_t &ctx,
compute::compute_stream_t *compute_stream, dim_t batch, dim_t dhc,
dim_t sic, dim_t n_iter, dim_t n_layer, dim_t n_dir, dim_t n_states,
dim_t states_ws_ld, dim_t scratch_diff_states_ld,
Expand Down Expand Up @@ -1420,7 +1420,7 @@ status_t _simple_rnn_common_t<aprop>::copy_init_iter(const exec_ctx_t &ctx,
}

template <prop_kind_t aprop>
status_t _simple_rnn_common_t<aprop>::copy_res_layer(const exec_ctx_t &ctx,
status_t simple_rnn_common_t<aprop>::copy_res_layer(const exec_ctx_t &ctx,
compute::compute_stream_t *compute_stream, bool lr, bool rl,
dim_t batch, dim_t dhc, dim_t slc, dim_t n_iter, dim_t n_layer,
dim_t n_dir, dim_t n_states, dim_t states_ws_ld,
Expand Down Expand Up @@ -1482,7 +1482,7 @@ status_t _simple_rnn_common_t<aprop>::copy_res_layer(const exec_ctx_t &ctx,
}

template <prop_kind_t aprop>
status_t _simple_rnn_common_t<aprop>::copy_res_iter(const exec_ctx_t &ctx,
status_t simple_rnn_common_t<aprop>::copy_res_iter(const exec_ctx_t &ctx,
compute::compute_stream_t *compute_stream, dim_t batch, dim_t dhc,
dim_t sic, dim_t n_iter, dim_t n_layer, dim_t n_dir, dim_t n_states,
dim_t states_ws_ld, dim_t scratch_diff_states_ld,
Expand Down Expand Up @@ -1557,7 +1557,7 @@ status_t _simple_rnn_common_t<aprop>::copy_res_iter(const exec_ctx_t &ctx,
//********************* Execution function *********************//

template <prop_kind_t aprop>
status_t _simple_rnn_common_t<aprop>::execute_(const exec_ctx_t &ctx) const {
status_t simple_rnn_common_t<aprop>::execute_(const exec_ctx_t &ctx) const {

impl::engine_t *engine = ctx.stream()->engine();
auto *compute_stream
Expand Down Expand Up @@ -1722,8 +1722,8 @@ elemwise_sig_gru(simple_rnn_fwd_t::gru_elemwise);
template <>
elemwise_sig_gru(simple_rnn_bwd_t::gru_elemwise);

template struct _simple_rnn_common_t<prop_kind::forward>;
template struct _simple_rnn_common_t<prop_kind::backward>;
template struct simple_rnn_common_t<prop_kind::forward>;
template struct simple_rnn_common_t<prop_kind::backward>;

} // namespace ocl
} // namespace intel
Expand Down
8 changes: 4 additions & 4 deletions src/gpu/intel/ocl/rnn/rnn_grid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ enum gemm_kind_t {
};

template <prop_kind_t aprop>
struct _simple_rnn_common_t : public gpu_primitive_t {
struct simple_rnn_common_t : public gpu_primitive_t {
using gpu_primitive_t::gpu_primitive_t;

using class_name = _simple_rnn_common_t<aprop>;
using class_name = simple_rnn_common_t<aprop>;

using elemwise_f = elemwise_sig((class_name::*));
using elemwise_gru_f = elemwise_sig_gru((class_name::*));
Expand Down Expand Up @@ -263,8 +263,8 @@ struct _simple_rnn_common_t : public gpu_primitive_t {

enum { SCALES_ = 0, TM_SCALES_ = 1 };
};
using simple_rnn_fwd_t = _simple_rnn_common_t<prop_kind::forward>;
using simple_rnn_bwd_t = _simple_rnn_common_t<prop_kind::backward>;
using simple_rnn_fwd_t = simple_rnn_common_t<prop_kind::forward>;
using simple_rnn_bwd_t = simple_rnn_common_t<prop_kind::backward>;
} // namespace ocl
} // namespace intel
} // namespace gpu
Expand Down
12 changes: 6 additions & 6 deletions src/gpu/intel/ocl/rnn/simple_rnn_postgemm.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2024 Intel Corporation
* Copyright 2019-2025 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 Down Expand Up @@ -27,7 +27,7 @@ using namespace dnnl::impl::gpu::intel::gpu_utils;
using namespace rnn_utils;

template <prop_kind_t aprop>
elemwise_sig((_simple_rnn_common_t<aprop>::rnn_elemwise)) {
elemwise_sig((simple_rnn_common_t<aprop>::rnn_elemwise)) {
auto nd_range = get_nd_range({dhc,
utils::div_up(
batch, aprop == prop_kind::forward ? 1 : bwd_batch_block)});
Expand Down Expand Up @@ -101,7 +101,7 @@ template elemwise_sig(simple_rnn_fwd_t::rnn_elemwise);
template elemwise_sig(simple_rnn_bwd_t::rnn_elemwise);

template <prop_kind_t aprop>
elemwise_sig((_simple_rnn_common_t<aprop>::lstm_elemwise)) {
elemwise_sig((simple_rnn_common_t<aprop>::lstm_elemwise)) {
auto nd_range = get_nd_range({dhc,
utils::div_up(
batch, aprop == prop_kind::forward ? 1 : bwd_batch_block)});
Expand Down Expand Up @@ -176,7 +176,7 @@ template elemwise_sig(simple_rnn_fwd_t::lstm_elemwise);
template elemwise_sig(simple_rnn_bwd_t::lstm_elemwise);

template <prop_kind_t aprop>
elemwise_sig((_simple_rnn_common_t<aprop>::lstm_elemwise_u8s8)) {
elemwise_sig((simple_rnn_common_t<aprop>::lstm_elemwise_u8s8)) {
auto nd_range = get_nd_range({dhc,
utils::div_up(
batch, aprop == prop_kind::forward ? 1 : bwd_batch_block)});
Expand Down Expand Up @@ -235,7 +235,7 @@ template elemwise_sig(simple_rnn_fwd_t::lstm_elemwise_u8s8);
template elemwise_sig(simple_rnn_bwd_t::lstm_elemwise_u8s8);

template <prop_kind_t aprop>
elemwise_sig_gru_lbr((_simple_rnn_common_t<aprop>::gru_lbr_elemwise)) {
elemwise_sig_gru_lbr((simple_rnn_common_t<aprop>::gru_lbr_elemwise)) {
auto nd_range = get_nd_range({dhc,
utils::div_up(
batch, aprop == prop_kind::forward ? 1 : bwd_batch_block)});
Expand Down Expand Up @@ -311,7 +311,7 @@ template elemwise_sig_gru_lbr(simple_rnn_fwd_t::gru_lbr_elemwise);
template elemwise_sig_gru_lbr(simple_rnn_bwd_t::gru_lbr_elemwise);

template <prop_kind_t aprop>
elemwise_sig_gru((_simple_rnn_common_t<aprop>::gru_elemwise)) {
elemwise_sig_gru((simple_rnn_common_t<aprop>::gru_elemwise)) {
auto nd_range = get_nd_range({dhc,
utils::div_up(
batch, aprop == prop_kind::forward ? 1 : bwd_batch_block)});
Expand Down

0 comments on commit 6b90d64

Please sign in to comment.