1 | /******************************************************************************* |
2 | * Copyright 2019-2021 Intel Corporation |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. |
6 | * You may obtain a copy of the License at |
7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | * |
10 | * Unless required by applicable law or agreed to in writing, software |
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. |
15 | *******************************************************************************/ |
16 | |
17 | #ifndef GPU_GPU_MATMUL_PD_HPP |
18 | #define GPU_GPU_MATMUL_PD_HPP |
19 | |
20 | #include <assert.h> |
21 | |
22 | #include "common/c_types_map.hpp" |
23 | #include "common/matmul_pd.hpp" |
24 | |
25 | namespace dnnl { |
26 | namespace impl { |
27 | namespace gpu { |
28 | |
29 | struct gpu_matmul_pd_t : public matmul_pd_t { |
30 | using matmul_pd_t::matmul_pd_t; |
31 | |
32 | bool has_blocks() { |
33 | for (auto md : {&src_md_, &weights_md_, &bias_md_, &dst_md_}) { |
34 | memory_desc_wrapper mdw(md); |
35 | if (mdw.is_blocking_desc()) { |
36 | if (mdw.blocking_desc().inner_nblks != 0) { return true; } |
37 | } |
38 | } |
39 | return false; |
40 | } |
41 | }; |
42 | |
43 | } // namespace gpu |
44 | } // namespace impl |
45 | } // namespace dnnl |
46 | |
47 | #endif |
48 | |