66 #ifndef ACL_INTERNAL_TEST_CKW_IN_DF // Conv2d is not ported to ckw yet. COMPMID-6259
76 const auto t_input_shape =
TensorShape(384, 12, 12);
77 const auto t_weight_shape =
TensorShape(384, 1, 1, 16);
107 tensor->allocator()->allocate();
119 t_weight.allocator()->init(*weight_info);
120 t_dst.allocator()->init(*dst_info);
124 t_input.allocator()->allocate();
125 t_weight.allocator()->allocate();
126 t_dst.allocator()->allocate();
131 runtime.
run({&t_input, &t_weight, &t_dst});
139 fill<float>(ref_t_input, 0,
library.get());
140 fill<float>(ref_t_weight, 1,
library.get());
145 auto t_dst_shape_nchw = t_dst_shape;
148 PadStrideInfo legacy_pad_stride(conv2d_attr.stride().x(), conv2d_attr.stride().y(), conv2d_attr.pad().left,
149 conv2d_attr.pad().right, conv2d_attr.pad().top, conv2d_attr.pad().bottom,
152 t_dst_shape_nchw, legacy_pad_stride, conv2d_attr.dilation());
159 #endif // ACL_INTERNAL_TEST_CKW_IN_DF
160 TEST_CASE(Add_Output_Add_Output, framework::DatasetMode::ALL)
200 tensor->allocator()->allocate();
215 t_in_1.allocator()->init(*in_1_info);
216 t_in_2.allocator()->init(*in_2_info);
218 t_out_0.allocator()->init(*out_0_info);
219 t_out_1.allocator()->init(*out_1_info);
223 t_in_0.allocator()->allocate();
224 t_in_1.allocator()->allocate();
225 t_in_2.allocator()->allocate();
227 t_out_0.allocator()->allocate();
228 t_out_1.allocator()->allocate();
235 runtime.
run({&t_in_0, &t_in_1, &t_in_2, &t_out_0, &t_out_1});
246 fill<float>(ref_t_in_0, 0,
library.get());
247 fill<float>(ref_t_in_1, 1,
library.get());
248 fill<float>(ref_t_in_2, 2,
library.get());
259 TEST_CASE(Add_Output_Add_Cast_Cast_Output, framework::DatasetMode::ALL)
307 tensor->allocator()->allocate();
322 t_in_1.allocator()->init(*in_1_info);
323 t_in_2.allocator()->init(*in_2_info);
325 t_out_0.allocator()->init(*out_0_info);
326 t_out_1.allocator()->init(*out_1_info);
330 t_in_0.allocator()->allocate();
331 t_in_1.allocator()->allocate();
332 t_in_2.allocator()->allocate();
334 t_out_0.allocator()->allocate();
335 t_out_1.allocator()->allocate();
342 runtime.
run({&t_in_0, &t_in_1, &t_in_2, &t_out_0, &t_out_1});
353 fill<float>(ref_t_in_0, 0,
library.get());
354 fill<float>(ref_t_in_1, 1,
library.get());
355 fill<float>(ref_t_in_2, 2,
library.get());
360 const auto ref_t_ans_2 =
362 const auto ref_t_out_1 =
371 #ifndef ACL_INTERNAL_TEST_CKW_IN_DF // Conv2d is not ported to ckw yet. COMPMID-6259
372 TEST_CASE(Conv2d_Sigmoid_DepthwiseConv2d_Mul, framework::DatasetMode::ALL)
448 framework::LogLevel::ERRORS);
449 auto ans_info =
GpuConv2d::create_op(sketch0, tensor0_info, tensor1_info, tensor2_info, conv2d_attr);
458 framework::LogLevel::ERRORS);
460 auto tensor5_info =
context.create_tensor_info();
472 framework::LogLevel::ERRORS);
478 auto tensor6_info =
context.create_tensor_info();
514 auto tensor = std::get<0>(data);
516 auto mem_req = std::get<2>(data);
519 tensor->allocator()->allocate();
524 auto tensor = std::get<0>(data);
526 auto mem_req = std::get<2>(data);
529 tensor->allocator()->allocate();
540 runtime0.
run({&tensor0, &tensor1, &tensor2, &tensor5});
541 runtime1.
run({&tensor5, &tensor3, &tensor4, &tensor2, &tensor6});
550 fill<float>(ref_conv2d_src, 0,
library.get());
551 fill<float>(ref_conv2d_wei, 1,
library.get());
552 fill<float>(ref_conv2d_bia, 2,
library.get());
553 fill<float>(ref_dwc_wei, 3,
library.get());
554 fill<float>(ref_dwc_bia, 4,
library.get());
558 auto conv2d_dst_shape_nchw = conv2d_dst_shape;
559 permute(conv2d_dst_shape_nchw, nhwc_to_nchw);
564 ref_conv2d_src_nchw, ref_conv2d_wei_nchw, ref_conv2d_bia_nchw, conv2d_dst_shape_nchw,
PadStrideInfo());
567 ref_conv2d_dst_nchw,
ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC));
569 auto dwc_dst_shape_nchw = dwc_dst_shape;
570 permute(dwc_dst_shape_nchw, nhwc_to_nchw);
574 ref_sigmoid_dst_nchw, ref_dwc_wei_nchw, ref_dwc_bia_nchw, dwc_dst_shape_nchw,
PadStrideInfo(), 1);
576 const auto ref_mul_dst_nchw = reference::pixel_wise_multiplication<float, float, float>(
583 #endif // ACL_INTERNAL_TEST_CKW_IN_DF
595 const auto t_input_shape =
TensorShape(384, 12, 12);
596 const auto t_weight_shape =
TensorShape(384, 1, 1, 16);
629 const auto expected_error_str =
"Operator fusion test failed. This operator cannot be fused into the workload";
633 framework::LogLevel::ERRORS);