| 117 | } |
| 118 | |
| 119 | void ClDirectConv3dKernel::configure(const CLCompileContext &compile_context, |
| 120 | const ITensorInfo *src0, |
| 121 | const ITensorInfo *src1, |
| 122 | const ITensorInfo *src2, |
| 123 | ITensorInfo *dst, |
| 124 | const Conv3dInfo &conv3d_info) |
| 125 | { |
| 126 | ARM_COMPUTE_ERROR_ON_NULLPTR(src0, src1, dst); |
| 127 | |
| 128 | // Perform validation |
| 129 | ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src0, src1, src2, dst, conv3d_info)); |
| 130 | |
| 131 | // Create window and update padding |
| 132 | const DataType data_type = src0->data_type(); |
| 133 | const size_t src_width = src0->dimension(1); |
| 134 | const size_t src_height = src0->dimension(2); |
| 135 | const size_t src_depth = src0->dimension(3); |
| 136 | const size_t src_channels = src0->dimension(0); |
| 137 | const size_t dst_width = dst->dimension(1); |
| 138 | const size_t dst_height = dst->dimension(2); |
| 139 | const size_t dst_depth = dst->dimension(3); |
| 140 | const size_t dst_channels = dst->dimension(0); |
| 141 | const size_t weights_width = src1->dimension(2); |
| 142 | const size_t weights_height = src1->dimension(3); |
| 143 | const size_t weights_depth = src1->dimension(4); |
| 144 | const size_t pad_left = conv3d_info.padding.left; |
| 145 | const size_t pad_top = conv3d_info.padding.top; |
| 146 | const size_t pad_front = conv3d_info.padding.front; |
| 147 | const size_t conv_stride_x = conv3d_info.stride.x(); |
| 148 | const size_t conv_stride_y = conv3d_info.stride.y(); |
| 149 | const size_t conv_stride_z = conv3d_info.stride.z(); |
| 150 | |
| 151 | const size_t n0 = std::min(dst->dimension(0), static_cast<size_t>(4u)); |
| 152 | const size_t m0 = (dst->tensor_shape()[0] > 16) ? ((data_type == DataType::F32) ? 2U : 4U) : 1U; |
| 153 | const size_t k0 = adjust_vec_size(8u, src0->dimension(0)); |
| 154 | const size_t partial_store_n0 = dst->dimension(0) % n0; |
| 155 | |
| 156 | CLBuildOptions build_options; |
| 157 | build_options.add_option("-cl-fast-relaxed-math"); |
| 158 | build_options.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(data_type)); |
| 159 | build_options.add_option("-DSRC_WIDTH=" + support::cpp11::to_string(src_width)); |
| 160 | build_options.add_option("-DSRC_HEIGHT=" + support::cpp11::to_string(src_height)); |
| 161 | build_options.add_option("-DSRC_DEPTH=" + support::cpp11::to_string(src_depth)); |
| 162 | build_options.add_option("-DSRC_CHANNELS=" + support::cpp11::to_string(src_channels)); |
| 163 | build_options.add_option("-DDST_WIDTH=" + support::cpp11::to_string(dst_width)); |
| 164 | build_options.add_option("-DDST_HEIGHT=" + support::cpp11::to_string(dst_height)); |
| 165 | build_options.add_option("-DDST_DEPTH=" + support::cpp11::to_string(dst_depth)); |
| 166 | build_options.add_option("-DDST_CHANNELS=" + support::cpp11::to_string(dst_channels)); |
| 167 | build_options.add_option("-DWEI_WIDTH=" + support::cpp11::to_string(weights_width)); |
| 168 | build_options.add_option("-DWEI_HEIGHT=" + support::cpp11::to_string(weights_height)); |
| 169 | build_options.add_option("-DWEI_DEPTH=" + support::cpp11::to_string(weights_depth)); |
| 170 | build_options.add_option("-DSTRIDE_X=" + support::cpp11::to_string(conv_stride_x)); |
| 171 | build_options.add_option("-DSTRIDE_Y=" + support::cpp11::to_string(conv_stride_y)); |
| 172 | build_options.add_option("-DSTRIDE_Z=" + support::cpp11::to_string(conv_stride_z)); |
| 173 | build_options.add_option("-DPAD_LEFT=" + support::cpp11::to_string(pad_left)); |
| 174 | build_options.add_option("-DPAD_TOP=" + support::cpp11::to_string(pad_top)); |
| 175 | build_options.add_option("-DPAD_FRONT=" + support::cpp11::to_string(pad_front)); |
| 176 | build_options.add_option("-DN0=" + support::cpp11::to_string(n0)); |
nothing calls this directly
no test coverage detected