From 295fe33f0484947432343aaa453b89fb58fa206b Mon Sep 17 00:00:00 2001 From: "xuhongyao.xhy" Date: Wed, 3 Mar 2021 03:00:26 +0000 Subject: [PATCH] [UnitTest]update onnx ops 1.5.0->1.8.0 --- .../lit_cases/test_dnnl/test_adagrad_dnnl.cc | 34 +++++++++++++++ .../test_dnnl/test_adagrad_multiple_dnnl.cc | 39 +++++++++++++++++ .../lit_cases/test_dnnl/test_adam_dnnl.cc | 36 ++++++++++++++++ .../test_dnnl/test_adam_multiple_dnnl.cc | 43 +++++++++++++++++++ ...ult_axis_example_select_last_index_dnnl.cc | 29 +++++++++++++ ...ault_axis_random_select_last_index_dnnl.cc | 29 +++++++++++++ ...keepdims_example_select_last_index_dnnl.cc | 29 +++++++++++++ ..._keepdims_random_select_last_index_dnnl.cc | 29 +++++++++++++ ...max_negative_axis_keepdims_example_dnnl.cc | 29 +++++++++++++ ...keepdims_example_select_last_index_dnnl.cc | 29 +++++++++++++ ...gmax_negative_axis_keepdims_random_dnnl.cc | 29 +++++++++++++ ..._keepdims_random_select_last_index_dnnl.cc | 29 +++++++++++++ ...keepdims_example_select_last_index_dnnl.cc | 29 +++++++++++++ ..._keepdims_random_select_last_index_dnnl.cc | 29 +++++++++++++ ...ult_axis_example_select_last_index_dnnl.cc | 29 +++++++++++++ ...ault_axis_random_select_last_index_dnnl.cc | 29 +++++++++++++ ...keepdims_example_select_last_index_dnnl.cc | 29 +++++++++++++ ..._keepdims_random_select_last_index_dnnl.cc | 29 +++++++++++++ ...min_negative_axis_keepdims_example_dnnl.cc | 29 +++++++++++++ ...keepdims_example_select_last_index_dnnl.cc | 29 +++++++++++++ ...gmin_negative_axis_keepdims_random_dnnl.cc | 29 +++++++++++++ ..._keepdims_random_select_last_index_dnnl.cc | 29 +++++++++++++ ...keepdims_example_select_last_index_dnnl.cc | 29 +++++++++++++ ..._keepdims_random_select_last_index_dnnl.cc | 29 +++++++++++++ .../test_bitshift_left_uint16_dnnl.cc | 30 +++++++++++++ .../test_bitshift_left_uint32_dnnl.cc | 30 +++++++++++++ .../test_bitshift_left_uint64_dnnl.cc | 30 +++++++++++++ .../test_bitshift_left_uint8_dnnl.cc | 30 +++++++++++++ .../test_bitshift_right_uint16_dnnl.cc | 30 +++++++++++++ .../test_bitshift_right_uint32_dnnl.cc | 30 +++++++++++++ .../test_bitshift_right_uint64_dnnl.cc | 30 +++++++++++++ .../test_bitshift_right_uint8_dnnl.cc | 30 +++++++++++++ .../test_cast_BFLOAT16_to_FLOAT_dnnl.cc | 29 +++++++++++++ .../test_cast_FLOAT_to_BFLOAT16_dnnl.cc | 29 +++++++++++++ .../lit_cases/test_dnnl/test_celu_dnnl.cc | 29 +++++++++++++ .../test_dnnl/test_celu_expanded_dnnl.cc | 29 +++++++++++++ .../test_clip_default_int8_inbounds_dnnl.cc | 29 +++++++++++++ .../test_clip_default_int8_max_dnnl.cc | 30 +++++++++++++ .../test_clip_default_int8_min_dnnl.cc | 30 +++++++++++++ .../test_compress_negative_axis_dnnl.cc | 30 +++++++++++++ .../test_concat_1d_axis_negative_1_dnnl.cc | 30 +++++++++++++ .../test_concat_2d_axis_negative_1_dnnl.cc | 30 +++++++++++++ .../test_concat_2d_axis_negative_2_dnnl.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_1_dnnl.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_2_dnnl.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_3_dnnl.cc | 30 +++++++++++++ ...est_constantofshape_int_shape_zero_dnnl.cc | 29 +++++++++++++ .../test_dnnl/test_cumsum_1d_dnnl.cc | 30 +++++++++++++ .../test_cumsum_1d_exclusive_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_cumsum_1d_reverse_dnnl.cc | 30 +++++++++++++ .../test_cumsum_1d_reverse_exclusive_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_cumsum_2d_axis_0_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_cumsum_2d_axis_1_dnnl.cc | 30 +++++++++++++ .../test_cumsum_2d_negative_axis_dnnl.cc | 30 +++++++++++++ .../test_depthtospace_crd_mode_dnnl.cc | 29 +++++++++++++ ...test_depthtospace_crd_mode_example_dnnl.cc | 29 +++++++++++++ .../test_depthtospace_dcr_mode_dnnl.cc | 29 +++++++++++++ .../test_dequantizelinear_axis_dnnl.cc | 31 +++++++++++++ .../lit_cases/test_dnnl/test_det_2d_dnnl.cc | 29 +++++++++++++ .../lit_cases/test_dnnl/test_det_nd_dnnl.cc | 29 +++++++++++++ .../test_dropout_default_mask_dnnl.cc | 30 +++++++++++++ .../test_dropout_default_mask_ratio_dnnl.cc | 31 +++++++++++++ .../test_dropout_default_old_dnnl.cc | 29 +++++++++++++ .../test_dropout_default_ratio_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_dropout_random_old_dnnl.cc | 29 +++++++++++++ .../test_dynamicquantizelinear_dnnl.cc | 31 +++++++++++++ ...est_dynamicquantizelinear_expanded_dnnl.cc | 31 +++++++++++++ ...dynamicquantizelinear_max_adjusted_dnnl.cc | 31 +++++++++++++ ...antizelinear_max_adjusted_expanded_dnnl.cc | 31 +++++++++++++ ...dynamicquantizelinear_min_adjusted_dnnl.cc | 31 +++++++++++++ ...antizelinear_min_adjusted_expanded_dnnl.cc | 31 +++++++++++++ .../test_einsum_batch_diagonal_dnnl.cc | 29 +++++++++++++ .../test_einsum_batch_matmul_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_einsum_inner_prod_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_einsum_sum_dnnl.cc | 29 +++++++++++++ .../test_dnnl/test_einsum_transpose_dnnl.cc | 29 +++++++++++++ .../test_flatten_negative_axis1_dnnl.cc | 29 +++++++++++++ .../test_flatten_negative_axis2_dnnl.cc | 29 +++++++++++++ .../test_flatten_negative_axis3_dnnl.cc | 29 +++++++++++++ .../test_flatten_negative_axis4_dnnl.cc | 29 +++++++++++++ .../test_dnnl/test_gather_2d_indices_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_gather_elements_0_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_gather_elements_1_dnnl.cc | 30 +++++++++++++ ...t_gather_elements_negative_indices_dnnl.cc | 30 +++++++++++++ .../test_gather_negative_indices_dnnl.cc | 30 +++++++++++++ .../test_gathernd_example_float32_dnnl.cc | 30 +++++++++++++ ..._gathernd_example_int32_batch_dim1_dnnl.cc | 30 +++++++++++++ .../test_gathernd_example_int32_dnnl.cc | 30 +++++++++++++ .../test_gemm_all_attributes_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_gemm_alpha_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_gemm_beta_dnnl.cc | 31 +++++++++++++ .../test_gemm_default_matrix_bias_dnnl.cc | 31 +++++++++++++ .../test_gemm_default_no_bias_dnnl.cc | 30 +++++++++++++ .../test_gemm_default_scalar_bias_dnnl.cc | 31 +++++++++++++ ...mm_default_single_elem_vector_bias_dnnl.cc | 31 +++++++++++++ .../test_gemm_default_vector_bias_dnnl.cc | 31 +++++++++++++ .../test_gemm_default_zero_bias_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_gemm_transposeA_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_gemm_transposeB_dnnl.cc | 31 +++++++++++++ .../test_greater_equal_bcast_dnnl.cc | 30 +++++++++++++ .../test_greater_equal_bcast_expanded_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_greater_equal_dnnl.cc | 30 +++++++++++++ .../test_greater_equal_expanded_dnnl.cc | 30 +++++++++++++ .../test_hardmax_negative_axis_dnnl.cc | 29 +++++++++++++ .../lit_cases/test_dnnl/test_if_dnnl.cc | 29 +++++++++++++ .../lit_cases/test_dnnl/test_if_seq_dnnl.cc | 29 +++++++++++++ .../test_dnnl/test_less_equal_bcast_dnnl.cc | 30 +++++++++++++ .../test_less_equal_bcast_expanded_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_less_equal_dnnl.cc | 30 +++++++++++++ .../test_less_equal_expanded_dnnl.cc | 30 +++++++++++++ .../test_logsoftmax_axis_0_expanded_dnnl.cc | 29 +++++++++++++ .../test_logsoftmax_axis_1_expanded_dnnl.cc | 29 +++++++++++++ .../test_logsoftmax_axis_2_expanded_dnnl.cc | 29 +++++++++++++ ...t_logsoftmax_default_axis_expanded_dnnl.cc | 29 +++++++++++++ ...test_logsoftmax_example_1_expanded_dnnl.cc | 29 +++++++++++++ ...t_logsoftmax_large_number_expanded_dnnl.cc | 29 +++++++++++++ .../test_logsoftmax_negative_axis_dnnl.cc | 29 +++++++++++++ ..._logsoftmax_negative_axis_expanded_dnnl.cc | 29 +++++++++++++ .../lit_cases/test_dnnl/test_loop11_dnnl.cc | 32 ++++++++++++++ .../test_dnnl/test_loop13_seq_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_max_float16_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_max_float32_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_max_float64_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_max_int16_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_max_int32_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_max_int64_dnnl.cc | 30 +++++++++++++ .../lit_cases/test_dnnl/test_max_int8_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_max_uint16_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_max_uint32_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_max_uint64_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_max_uint8_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_maxpool_2d_uint8_dnnl.cc | 29 +++++++++++++ .../test_dnnl/test_min_float16_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_min_float32_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_min_float64_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_min_int16_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_min_int32_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_min_int64_dnnl.cc | 30 +++++++++++++ .../lit_cases/test_dnnl/test_min_int8_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_min_uint16_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_min_uint32_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_min_uint64_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_min_uint8_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_mod_broadcast_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_mod_int64_fmod_dnnl.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float16_dnnl.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float32_dnnl.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float64_dnnl.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int16_dnnl.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int32_dnnl.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int64_dnnl.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int8_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_mod_uint16_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_mod_uint32_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_mod_uint64_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_mod_uint8_dnnl.cc | 30 +++++++++++++ .../lit_cases/test_dnnl/test_momentum_dnnl.cc | 34 +++++++++++++++ .../test_dnnl/test_momentum_multiple_dnnl.cc | 39 +++++++++++++++++ .../test_dnnl/test_nesterov_momentum_dnnl.cc | 34 +++++++++++++++ .../test_dnnl/test_nllloss_NC_dnnl.cc | 30 +++++++++++++ .../test_nllloss_NC_expanded_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_nllloss_NCd1_dnnl.cc | 30 +++++++++++++ .../test_nllloss_NCd1_expanded_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_nllloss_NCd1_ii_dnnl.cc | 30 +++++++++++++ .../test_nllloss_NCd1_ii_expanded_dnnl.cc | 30 +++++++++++++ ...lloss_NCd1_mean_weight_negative_ii_dnnl.cc | 31 +++++++++++++ ...1_mean_weight_negative_ii_expanded_dnnl.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_dnnl.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_expanded_dnnl.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_ii_dnnl.cc | 31 +++++++++++++ ...st_nllloss_NCd1_weight_ii_expanded_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_nllloss_NCd1d2_dnnl.cc | 30 +++++++++++++ .../test_nllloss_NCd1d2_expanded_dnnl.cc | 30 +++++++++++++ ...NCd1d2_no_weight_reduction_mean_ii_dnnl.cc | 30 +++++++++++++ ..._weight_reduction_mean_ii_expanded_dnnl.cc | 30 +++++++++++++ ...test_nllloss_NCd1d2_reduction_mean_dnnl.cc | 30 +++++++++++++ ...oss_NCd1d2_reduction_mean_expanded_dnnl.cc | 30 +++++++++++++ .../test_nllloss_NCd1d2_reduction_sum_dnnl.cc | 30 +++++++++++++ ...loss_NCd1d2_reduction_sum_expanded_dnnl.cc | 30 +++++++++++++ .../test_nllloss_NCd1d2_with_weight_dnnl.cc | 31 +++++++++++++ ...llloss_NCd1d2_with_weight_expanded_dnnl.cc | 31 +++++++++++++ ..._NCd1d2_with_weight_reduction_mean_dnnl.cc | 31 +++++++++++++ ...ith_weight_reduction_mean_expanded_dnnl.cc | 31 +++++++++++++ ...s_NCd1d2_with_weight_reduction_sum_dnnl.cc | 31 +++++++++++++ ...with_weight_reduction_sum_expanded_dnnl.cc | 31 +++++++++++++ ...Cd1d2_with_weight_reduction_sum_ii_dnnl.cc | 31 +++++++++++++ ...h_weight_reduction_sum_ii_expanded_dnnl.cc | 31 +++++++++++++ ...Cd1d2d3_none_no_weight_negative_ii_dnnl.cc | 30 +++++++++++++ ...one_no_weight_negative_ii_expanded_dnnl.cc | 30 +++++++++++++ ...llloss_NCd1d2d3_sum_weight_high_ii_dnnl.cc | 31 +++++++++++++ ...d1d2d3_sum_weight_high_ii_expanded_dnnl.cc | 31 +++++++++++++ ...t_nllloss_NCd1d2d3d4d5_mean_weight_dnnl.cc | 31 +++++++++++++ ..._NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc | 31 +++++++++++++ ...llloss_NCd1d2d3d4d5_none_no_weight_dnnl.cc | 30 +++++++++++++ ...d1d2d3d4d5_none_no_weight_expanded_dnnl.cc | 30 +++++++++++++ .../test_onehot_negative_indices_dnnl.cc | 31 +++++++++++++ .../test_onehot_with_negative_axis_dnnl.cc | 31 +++++++++++++ .../test_pow_types_float32_int32_dnnl.cc | 30 +++++++++++++ .../test_pow_types_float32_int64_dnnl.cc | 30 +++++++++++++ .../test_pow_types_float32_uint32_dnnl.cc | 30 +++++++++++++ .../test_pow_types_float32_uint64_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_pow_types_float_dnnl.cc | 30 +++++++++++++ .../test_pow_types_int32_float32_dnnl.cc | 30 +++++++++++++ .../test_pow_types_int32_int32_dnnl.cc | 30 +++++++++++++ .../test_pow_types_int64_float32_dnnl.cc | 30 +++++++++++++ .../test_pow_types_int64_int64_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_pow_types_int_dnnl.cc | 30 +++++++++++++ .../test_quantizelinear_axis_dnnl.cc | 31 +++++++++++++ ...st_range_float_type_positive_delta_dnnl.cc | 31 +++++++++++++ ...float_type_positive_delta_expanded_dnnl.cc | 31 +++++++++++++ ...st_range_int32_type_negative_delta_dnnl.cc | 31 +++++++++++++ ...int32_type_negative_delta_expanded_dnnl.cc | 31 +++++++++++++ ...l1_negative_axes_keep_dims_example_dnnl.cc | 29 +++++++++++++ ..._l1_negative_axes_keep_dims_random_dnnl.cc | 29 +++++++++++++ ...l2_negative_axes_keep_dims_example_dnnl.cc | 29 +++++++++++++ ..._l2_negative_axes_keep_dims_random_dnnl.cc | 29 +++++++++++++ ...exp_negative_axes_keepdims_example_dnnl.cc | 29 +++++++++++++ ..._exp_negative_axes_keepdims_random_dnnl.cc | 29 +++++++++++++ .../test_reduce_log_sum_negative_axes_dnnl.cc | 29 +++++++++++++ ...max_negative_axes_keepdims_example_dnnl.cc | 29 +++++++++++++ ..._max_negative_axes_keepdims_random_dnnl.cc | 29 +++++++++++++ ...ean_negative_axes_keepdims_example_dnnl.cc | 29 +++++++++++++ ...mean_negative_axes_keepdims_random_dnnl.cc | 29 +++++++++++++ ...min_negative_axes_keepdims_example_dnnl.cc | 29 +++++++++++++ ..._min_negative_axes_keepdims_random_dnnl.cc | 29 +++++++++++++ ...rod_negative_axes_keepdims_example_dnnl.cc | 29 +++++++++++++ ...prod_negative_axes_keepdims_random_dnnl.cc | 29 +++++++++++++ ..._sum_empty_axes_input_noop_example_dnnl.cc | 30 +++++++++++++ ...e_sum_empty_axes_input_noop_random_dnnl.cc | 30 +++++++++++++ ...sum_negative_axes_keepdims_example_dnnl.cc | 30 +++++++++++++ ..._sum_negative_axes_keepdims_random_dnnl.cc | 30 +++++++++++++ ...are_negative_axes_keepdims_example_dnnl.cc | 29 +++++++++++++ ...uare_negative_axes_keepdims_random_dnnl.cc | 29 +++++++++++++ ...est_reshape_negative_extended_dims_dnnl.cc | 30 +++++++++++++ .../test_reshape_reordered_all_dims_dnnl.cc | 30 +++++++++++++ .../test_reshape_reordered_last_dims_dnnl.cc | 30 +++++++++++++ ...test_reshape_zero_and_negative_dim_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_reshape_zero_dim_dnnl.cc | 30 +++++++++++++ ...cales_cubic_A_n0p5_exclude_outside_dnnl.cc | 30 +++++++++++++ ...nsample_scales_cubic_align_corners_dnnl.cc | 30 +++++++++++++ ...est_resize_downsample_scales_cubic_dnnl.cc | 30 +++++++++++++ ...sample_scales_linear_align_corners_dnnl.cc | 30 +++++++++++++ ...st_resize_downsample_scales_linear_dnnl.cc | 30 +++++++++++++ ...t_resize_downsample_scales_nearest_dnnl.cc | 30 +++++++++++++ ...test_resize_downsample_sizes_cubic_dnnl.cc | 30 +++++++++++++ ...le_sizes_linear_pytorch_half_pixel_dnnl.cc | 30 +++++++++++++ ...st_resize_downsample_sizes_nearest_dnnl.cc | 30 +++++++++++++ ...sizes_nearest_tf_half_pixel_for_nn_dnnl.cc | 32 ++++++++++++++ .../test_resize_tf_crop_and_resize_dnnl.cc | 31 +++++++++++++ ...cales_cubic_A_n0p5_exclude_outside_dnnl.cc | 30 +++++++++++++ ...psample_scales_cubic_align_corners_dnnl.cc | 30 +++++++++++++ ...e_upsample_scales_cubic_asymmetric_dnnl.cc | 30 +++++++++++++ .../test_resize_upsample_scales_cubic_dnnl.cc | 30 +++++++++++++ ...sample_scales_linear_align_corners_dnnl.cc | 30 +++++++++++++ ...test_resize_upsample_scales_linear_dnnl.cc | 30 +++++++++++++ ...est_resize_upsample_scales_nearest_dnnl.cc | 30 +++++++++++++ .../test_resize_upsample_sizes_cubic_dnnl.cc | 30 +++++++++++++ ...mple_sizes_nearest_ceil_half_pixel_dnnl.cc | 30 +++++++++++++ ...test_resize_upsample_sizes_nearest_dnnl.cc | 30 +++++++++++++ ..._sizes_nearest_floor_align_corners_dnnl.cc | 30 +++++++++++++ ...arest_round_prefer_ceil_asymmetric_dnnl.cc | 30 +++++++++++++ .../lit_cases/test_dnnl/test_round_dnnl.cc | 29 +++++++++++++ .../test_scatter_elements_with_axis_dnnl.cc | 31 +++++++++++++ ...ter_elements_with_negative_indices_dnnl.cc | 31 +++++++++++++ ...test_scatter_elements_without_axis_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_scatternd_dnnl.cc | 31 +++++++++++++ ...t_sce_NCd1_mean_weight_negative_ii_dnnl.cc | 31 +++++++++++++ ...1_mean_weight_negative_ii_expanded_dnnl.cc | 31 +++++++++++++ ...1_mean_weight_negative_ii_log_prob_dnnl.cc | 32 ++++++++++++++ ...ight_negative_ii_log_prob_expanded_dnnl.cc | 32 ++++++++++++++ ...Cd1d2d3_none_no_weight_negative_ii_dnnl.cc | 30 +++++++++++++ ...one_no_weight_negative_ii_expanded_dnnl.cc | 30 +++++++++++++ ...one_no_weight_negative_ii_log_prob_dnnl.cc | 31 +++++++++++++ ...ight_negative_ii_log_prob_expanded_dnnl.cc | 31 +++++++++++++ ...st_sce_NCd1d2d3_sum_weight_high_ii_dnnl.cc | 31 +++++++++++++ ...d1d2d3_sum_weight_high_ii_expanded_dnnl.cc | 31 +++++++++++++ ...d1d2d3_sum_weight_high_ii_log_prob_dnnl.cc | 32 ++++++++++++++ ...m_weight_high_ii_log_prob_expanded_dnnl.cc | 32 ++++++++++++++ .../test_sce_NCd1d2d3d4d5_mean_weight_dnnl.cc | 31 +++++++++++++ ..._NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc | 31 +++++++++++++ ..._NCd1d2d3d4d5_mean_weight_log_prob_dnnl.cc | 32 ++++++++++++++ ...d4d5_mean_weight_log_prob_expanded_dnnl.cc | 32 ++++++++++++++ ...st_sce_NCd1d2d3d4d5_none_no_weight_dnnl.cc | 30 +++++++++++++ ...d1d2d3d4d5_none_no_weight_expanded_dnnl.cc | 30 +++++++++++++ ...d1d2d3d4d5_none_no_weight_log_prob_dnnl.cc | 31 +++++++++++++ ...5_none_no_weight_log_prob_expanded_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_sce_mean_3d_dnnl.cc | 30 +++++++++++++ .../test_sce_mean_3d_expanded_dnnl.cc | 30 +++++++++++++ .../test_sce_mean_3d_log_prob_dnnl.cc | 31 +++++++++++++ ...test_sce_mean_3d_log_prob_expanded_dnnl.cc | 31 +++++++++++++ .../lit_cases/test_dnnl/test_sce_mean_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_sce_mean_expanded_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_sce_mean_log_prob_dnnl.cc | 31 +++++++++++++ .../test_sce_mean_log_prob_expanded_dnnl.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_3d_dnnl.cc | 30 +++++++++++++ ..._sce_mean_no_weight_ii_3d_expanded_dnnl.cc | 30 +++++++++++++ ..._sce_mean_no_weight_ii_3d_log_prob_dnnl.cc | 31 +++++++++++++ ..._no_weight_ii_3d_log_prob_expanded_dnnl.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_4d_dnnl.cc | 30 +++++++++++++ ..._sce_mean_no_weight_ii_4d_expanded_dnnl.cc | 30 +++++++++++++ ..._sce_mean_no_weight_ii_4d_log_prob_dnnl.cc | 31 +++++++++++++ ..._no_weight_ii_4d_log_prob_expanded_dnnl.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_dnnl.cc | 30 +++++++++++++ ...est_sce_mean_no_weight_ii_expanded_dnnl.cc | 30 +++++++++++++ ...est_sce_mean_no_weight_ii_log_prob_dnnl.cc | 31 +++++++++++++ ...ean_no_weight_ii_log_prob_expanded_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_sce_mean_weight_dnnl.cc | 31 +++++++++++++ .../test_sce_mean_weight_expanded_dnnl.cc | 31 +++++++++++++ .../test_sce_mean_weight_ii_3d_dnnl.cc | 31 +++++++++++++ ...est_sce_mean_weight_ii_3d_expanded_dnnl.cc | 31 +++++++++++++ ...est_sce_mean_weight_ii_3d_log_prob_dnnl.cc | 32 ++++++++++++++ ...ean_weight_ii_3d_log_prob_expanded_dnnl.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_4d_dnnl.cc | 31 +++++++++++++ ...est_sce_mean_weight_ii_4d_expanded_dnnl.cc | 31 +++++++++++++ ...est_sce_mean_weight_ii_4d_log_prob_dnnl.cc | 32 ++++++++++++++ ...ean_weight_ii_4d_log_prob_expanded_dnnl.cc | 32 ++++++++++++++ .../test_dnnl/test_sce_mean_weight_ii_dnnl.cc | 31 +++++++++++++ .../test_sce_mean_weight_ii_expanded_dnnl.cc | 31 +++++++++++++ .../test_sce_mean_weight_ii_log_prob_dnnl.cc | 32 ++++++++++++++ ...e_mean_weight_ii_log_prob_expanded_dnnl.cc | 32 ++++++++++++++ .../test_sce_mean_weight_log_prob_dnnl.cc | 32 ++++++++++++++ ..._sce_mean_weight_log_prob_expanded_dnnl.cc | 32 ++++++++++++++ .../lit_cases/test_dnnl/test_sce_none_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_sce_none_expanded_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_sce_none_log_prob_dnnl.cc | 31 +++++++++++++ .../test_sce_none_log_prob_expanded_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_sce_none_weights_dnnl.cc | 31 +++++++++++++ .../test_sce_none_weights_expanded_dnnl.cc | 31 +++++++++++++ .../test_sce_none_weights_log_prob_dnnl.cc | 32 ++++++++++++++ ...sce_none_weights_log_prob_expanded_dnnl.cc | 32 ++++++++++++++ .../lit_cases/test_dnnl/test_sce_sum_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_sce_sum_expanded_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_sce_sum_log_prob_dnnl.cc | 31 +++++++++++++ .../test_sce_sum_log_prob_expanded_dnnl.cc | 31 +++++++++++++ .../test_sequence_insert_at_back_dnnl.cc | 30 +++++++++++++ .../test_sequence_insert_at_front_dnnl.cc | 31 +++++++++++++ .../test_slice_negative_axes_dnnl.cc | 32 ++++++++++++++ .../test_softmax_axis_0_expanded_dnnl.cc | 29 +++++++++++++ .../test_softmax_axis_1_expanded_dnnl.cc | 29 +++++++++++++ .../test_softmax_axis_2_expanded_dnnl.cc | 29 +++++++++++++ ...test_softmax_default_axis_expanded_dnnl.cc | 29 +++++++++++++ .../test_softmax_example_expanded_dnnl.cc | 29 +++++++++++++ ...test_softmax_large_number_expanded_dnnl.cc | 29 +++++++++++++ .../test_softmax_negative_axis_dnnl.cc | 29 +++++++++++++ ...est_softmax_negative_axis_expanded_dnnl.cc | 29 +++++++++++++ .../test_split_zero_size_splits_dnnl.cc | 32 ++++++++++++++ .../test_squeeze_negative_axes_dnnl.cc | 30 +++++++++++++ .../test_top_k_negative_axis_dnnl.cc | 31 +++++++++++++ .../test_dnnl/test_top_k_smallest_dnnl.cc | 31 +++++++++++++ .../test_training_dropout_default_dnnl.cc | 31 +++++++++++++ ...test_training_dropout_default_mask_dnnl.cc | 32 ++++++++++++++ .../test_dnnl/test_training_dropout_dnnl.cc | 31 +++++++++++++ .../test_training_dropout_mask_dnnl.cc | 32 ++++++++++++++ .../test_training_dropout_zero_ratio_dnnl.cc | 31 +++++++++++++ ...t_training_dropout_zero_ratio_mask_dnnl.cc | 32 ++++++++++++++ ...est_unique_not_sorted_without_axis_dnnl.cc | 32 ++++++++++++++ .../test_unique_sorted_with_axis_3d_dnnl.cc | 32 ++++++++++++++ .../test_unique_sorted_with_axis_dnnl.cc | 32 ++++++++++++++ ...t_unique_sorted_with_negative_axis_dnnl.cc | 32 ++++++++++++++ .../test_unique_sorted_without_axis_dnnl.cc | 32 ++++++++++++++ .../test_dnnl/test_unsqueeze_axis_0_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_unsqueeze_axis_1_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_unsqueeze_axis_2_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_unsqueeze_axis_3_dnnl.cc | 29 +++++++++++++ .../test_unsqueeze_negative_axes_dnnl.cc | 30 +++++++++++++ .../test_unsqueeze_three_axes_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_unsqueeze_two_axes_dnnl.cc | 30 +++++++++++++ .../test_unsqueeze_unsorted_axes_dnnl.cc | 30 +++++++++++++ .../test_dnnl/test_where_long_example_dnnl.cc | 31 +++++++++++++ .../test_eigen/test_adagrad_eigen.cc | 34 +++++++++++++++ .../test_eigen/test_adagrad_multiple_eigen.cc | 39 +++++++++++++++++ .../lit_cases/test_eigen/test_adam_eigen.cc | 36 ++++++++++++++++ .../test_eigen/test_adam_multiple_eigen.cc | 43 +++++++++++++++++++ ...lt_axis_example_select_last_index_eigen.cc | 29 +++++++++++++ ...ult_axis_random_select_last_index_eigen.cc | 29 +++++++++++++ ...eepdims_example_select_last_index_eigen.cc | 29 +++++++++++++ ...keepdims_random_select_last_index_eigen.cc | 29 +++++++++++++ ...ax_negative_axis_keepdims_example_eigen.cc | 29 +++++++++++++ ...eepdims_example_select_last_index_eigen.cc | 29 +++++++++++++ ...max_negative_axis_keepdims_random_eigen.cc | 29 +++++++++++++ ...keepdims_random_select_last_index_eigen.cc | 29 +++++++++++++ ...eepdims_example_select_last_index_eigen.cc | 29 +++++++++++++ ...keepdims_random_select_last_index_eigen.cc | 29 +++++++++++++ ...lt_axis_example_select_last_index_eigen.cc | 29 +++++++++++++ ...ult_axis_random_select_last_index_eigen.cc | 29 +++++++++++++ ...eepdims_example_select_last_index_eigen.cc | 29 +++++++++++++ ...keepdims_random_select_last_index_eigen.cc | 29 +++++++++++++ ...in_negative_axis_keepdims_example_eigen.cc | 29 +++++++++++++ ...eepdims_example_select_last_index_eigen.cc | 29 +++++++++++++ ...min_negative_axis_keepdims_random_eigen.cc | 29 +++++++++++++ ...keepdims_random_select_last_index_eigen.cc | 29 +++++++++++++ ...eepdims_example_select_last_index_eigen.cc | 29 +++++++++++++ ...keepdims_random_select_last_index_eigen.cc | 29 +++++++++++++ .../test_bitshift_left_uint16_eigen.cc | 30 +++++++++++++ .../test_bitshift_left_uint32_eigen.cc | 30 +++++++++++++ .../test_bitshift_left_uint64_eigen.cc | 30 +++++++++++++ .../test_bitshift_left_uint8_eigen.cc | 30 +++++++++++++ .../test_bitshift_right_uint16_eigen.cc | 30 +++++++++++++ .../test_bitshift_right_uint32_eigen.cc | 30 +++++++++++++ .../test_bitshift_right_uint64_eigen.cc | 30 +++++++++++++ .../test_bitshift_right_uint8_eigen.cc | 30 +++++++++++++ .../test_cast_BFLOAT16_to_FLOAT_eigen.cc | 29 +++++++++++++ .../test_cast_FLOAT_to_BFLOAT16_eigen.cc | 29 +++++++++++++ .../lit_cases/test_eigen/test_celu_eigen.cc | 29 +++++++++++++ .../test_eigen/test_celu_expanded_eigen.cc | 29 +++++++++++++ .../test_clip_default_int8_inbounds_eigen.cc | 29 +++++++++++++ .../test_clip_default_int8_max_eigen.cc | 30 +++++++++++++ .../test_clip_default_int8_min_eigen.cc | 30 +++++++++++++ .../test_compress_negative_axis_eigen.cc | 30 +++++++++++++ .../test_concat_1d_axis_negative_1_eigen.cc | 30 +++++++++++++ .../test_concat_2d_axis_negative_1_eigen.cc | 30 +++++++++++++ .../test_concat_2d_axis_negative_2_eigen.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_1_eigen.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_2_eigen.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_3_eigen.cc | 30 +++++++++++++ ...st_constantofshape_int_shape_zero_eigen.cc | 29 +++++++++++++ .../test_eigen/test_cumsum_1d_eigen.cc | 30 +++++++++++++ .../test_cumsum_1d_exclusive_eigen.cc | 30 +++++++++++++ .../test_cumsum_1d_reverse_eigen.cc | 30 +++++++++++++ .../test_cumsum_1d_reverse_exclusive_eigen.cc | 30 +++++++++++++ .../test_eigen/test_cumsum_2d_axis_0_eigen.cc | 30 +++++++++++++ .../test_eigen/test_cumsum_2d_axis_1_eigen.cc | 30 +++++++++++++ .../test_cumsum_2d_negative_axis_eigen.cc | 30 +++++++++++++ .../test_depthtospace_crd_mode_eigen.cc | 29 +++++++++++++ ...est_depthtospace_crd_mode_example_eigen.cc | 29 +++++++++++++ .../test_depthtospace_dcr_mode_eigen.cc | 29 +++++++++++++ .../test_dequantizelinear_axis_eigen.cc | 31 +++++++++++++ .../lit_cases/test_eigen/test_det_2d_eigen.cc | 29 +++++++++++++ .../lit_cases/test_eigen/test_det_nd_eigen.cc | 29 +++++++++++++ .../test_dropout_default_mask_eigen.cc | 30 +++++++++++++ .../test_dropout_default_mask_ratio_eigen.cc | 31 +++++++++++++ .../test_dropout_default_old_eigen.cc | 29 +++++++++++++ .../test_dropout_default_ratio_eigen.cc | 30 +++++++++++++ .../test_dropout_random_old_eigen.cc | 29 +++++++++++++ .../test_dynamicquantizelinear_eigen.cc | 31 +++++++++++++ ...st_dynamicquantizelinear_expanded_eigen.cc | 31 +++++++++++++ ...ynamicquantizelinear_max_adjusted_eigen.cc | 31 +++++++++++++ ...ntizelinear_max_adjusted_expanded_eigen.cc | 31 +++++++++++++ ...ynamicquantizelinear_min_adjusted_eigen.cc | 31 +++++++++++++ ...ntizelinear_min_adjusted_expanded_eigen.cc | 31 +++++++++++++ .../test_einsum_batch_diagonal_eigen.cc | 29 +++++++++++++ .../test_einsum_batch_matmul_eigen.cc | 30 +++++++++++++ .../test_einsum_inner_prod_eigen.cc | 30 +++++++++++++ .../test_eigen/test_einsum_sum_eigen.cc | 29 +++++++++++++ .../test_eigen/test_einsum_transpose_eigen.cc | 29 +++++++++++++ .../test_flatten_negative_axis1_eigen.cc | 29 +++++++++++++ .../test_flatten_negative_axis2_eigen.cc | 29 +++++++++++++ .../test_flatten_negative_axis3_eigen.cc | 29 +++++++++++++ .../test_flatten_negative_axis4_eigen.cc | 29 +++++++++++++ .../test_gather_2d_indices_eigen.cc | 30 +++++++++++++ .../test_gather_elements_0_eigen.cc | 30 +++++++++++++ .../test_gather_elements_1_eigen.cc | 30 +++++++++++++ ..._gather_elements_negative_indices_eigen.cc | 30 +++++++++++++ .../test_gather_negative_indices_eigen.cc | 30 +++++++++++++ .../test_gathernd_example_float32_eigen.cc | 30 +++++++++++++ ...gathernd_example_int32_batch_dim1_eigen.cc | 30 +++++++++++++ .../test_gathernd_example_int32_eigen.cc | 30 +++++++++++++ .../test_gemm_all_attributes_eigen.cc | 31 +++++++++++++ .../test_eigen/test_gemm_alpha_eigen.cc | 31 +++++++++++++ .../test_eigen/test_gemm_beta_eigen.cc | 31 +++++++++++++ .../test_gemm_default_matrix_bias_eigen.cc | 31 +++++++++++++ .../test_gemm_default_no_bias_eigen.cc | 30 +++++++++++++ .../test_gemm_default_scalar_bias_eigen.cc | 31 +++++++++++++ ...m_default_single_elem_vector_bias_eigen.cc | 31 +++++++++++++ .../test_gemm_default_vector_bias_eigen.cc | 31 +++++++++++++ .../test_gemm_default_zero_bias_eigen.cc | 31 +++++++++++++ .../test_eigen/test_gemm_transposeA_eigen.cc | 31 +++++++++++++ .../test_eigen/test_gemm_transposeB_eigen.cc | 31 +++++++++++++ .../test_greater_equal_bcast_eigen.cc | 30 +++++++++++++ ...test_greater_equal_bcast_expanded_eigen.cc | 30 +++++++++++++ .../test_eigen/test_greater_equal_eigen.cc | 30 +++++++++++++ .../test_greater_equal_expanded_eigen.cc | 30 +++++++++++++ .../test_hardmax_negative_axis_eigen.cc | 29 +++++++++++++ .../lit_cases/test_eigen/test_if_eigen.cc | 29 +++++++++++++ .../lit_cases/test_eigen/test_if_seq_eigen.cc | 29 +++++++++++++ .../test_eigen/test_less_equal_bcast_eigen.cc | 30 +++++++++++++ .../test_less_equal_bcast_expanded_eigen.cc | 30 +++++++++++++ .../test_eigen/test_less_equal_eigen.cc | 30 +++++++++++++ .../test_less_equal_expanded_eigen.cc | 30 +++++++++++++ .../test_logsoftmax_axis_0_expanded_eigen.cc | 29 +++++++++++++ .../test_logsoftmax_axis_1_expanded_eigen.cc | 29 +++++++++++++ .../test_logsoftmax_axis_2_expanded_eigen.cc | 29 +++++++++++++ ..._logsoftmax_default_axis_expanded_eigen.cc | 29 +++++++++++++ ...est_logsoftmax_example_1_expanded_eigen.cc | 29 +++++++++++++ ..._logsoftmax_large_number_expanded_eigen.cc | 29 +++++++++++++ .../test_logsoftmax_negative_axis_eigen.cc | 29 +++++++++++++ ...logsoftmax_negative_axis_expanded_eigen.cc | 29 +++++++++++++ .../lit_cases/test_eigen/test_loop11_eigen.cc | 32 ++++++++++++++ .../test_eigen/test_loop13_seq_eigen.cc | 31 +++++++++++++ .../test_eigen/test_max_float16_eigen.cc | 30 +++++++++++++ .../test_eigen/test_max_float32_eigen.cc | 30 +++++++++++++ .../test_eigen/test_max_float64_eigen.cc | 30 +++++++++++++ .../test_eigen/test_max_int16_eigen.cc | 30 +++++++++++++ .../test_eigen/test_max_int32_eigen.cc | 30 +++++++++++++ .../test_eigen/test_max_int64_eigen.cc | 30 +++++++++++++ .../test_eigen/test_max_int8_eigen.cc | 30 +++++++++++++ .../test_eigen/test_max_uint16_eigen.cc | 30 +++++++++++++ .../test_eigen/test_max_uint32_eigen.cc | 30 +++++++++++++ .../test_eigen/test_max_uint64_eigen.cc | 30 +++++++++++++ .../test_eigen/test_max_uint8_eigen.cc | 30 +++++++++++++ .../test_eigen/test_maxpool_2d_uint8_eigen.cc | 29 +++++++++++++ .../test_eigen/test_min_float16_eigen.cc | 30 +++++++++++++ .../test_eigen/test_min_float32_eigen.cc | 30 +++++++++++++ .../test_eigen/test_min_float64_eigen.cc | 30 +++++++++++++ .../test_eigen/test_min_int16_eigen.cc | 30 +++++++++++++ .../test_eigen/test_min_int32_eigen.cc | 30 +++++++++++++ .../test_eigen/test_min_int64_eigen.cc | 30 +++++++++++++ .../test_eigen/test_min_int8_eigen.cc | 30 +++++++++++++ .../test_eigen/test_min_uint16_eigen.cc | 30 +++++++++++++ .../test_eigen/test_min_uint32_eigen.cc | 30 +++++++++++++ .../test_eigen/test_min_uint64_eigen.cc | 30 +++++++++++++ .../test_eigen/test_min_uint8_eigen.cc | 30 +++++++++++++ .../test_eigen/test_mod_broadcast_eigen.cc | 30 +++++++++++++ .../test_eigen/test_mod_int64_fmod_eigen.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float16_eigen.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float32_eigen.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float64_eigen.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int16_eigen.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int32_eigen.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int64_eigen.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int8_eigen.cc | 30 +++++++++++++ .../test_eigen/test_mod_uint16_eigen.cc | 30 +++++++++++++ .../test_eigen/test_mod_uint32_eigen.cc | 30 +++++++++++++ .../test_eigen/test_mod_uint64_eigen.cc | 30 +++++++++++++ .../test_eigen/test_mod_uint8_eigen.cc | 30 +++++++++++++ .../test_eigen/test_momentum_eigen.cc | 34 +++++++++++++++ .../test_momentum_multiple_eigen.cc | 39 +++++++++++++++++ .../test_nesterov_momentum_eigen.cc | 34 +++++++++++++++ .../test_eigen/test_nllloss_NC_eigen.cc | 30 +++++++++++++ .../test_nllloss_NC_expanded_eigen.cc | 30 +++++++++++++ .../test_eigen/test_nllloss_NCd1_eigen.cc | 30 +++++++++++++ .../test_nllloss_NCd1_expanded_eigen.cc | 30 +++++++++++++ .../test_eigen/test_nllloss_NCd1_ii_eigen.cc | 30 +++++++++++++ .../test_nllloss_NCd1_ii_expanded_eigen.cc | 30 +++++++++++++ ...loss_NCd1_mean_weight_negative_ii_eigen.cc | 31 +++++++++++++ ..._mean_weight_negative_ii_expanded_eigen.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_eigen.cc | 31 +++++++++++++ ...test_nllloss_NCd1_weight_expanded_eigen.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_ii_eigen.cc | 31 +++++++++++++ ...t_nllloss_NCd1_weight_ii_expanded_eigen.cc | 31 +++++++++++++ .../test_eigen/test_nllloss_NCd1d2_eigen.cc | 30 +++++++++++++ .../test_nllloss_NCd1d2_expanded_eigen.cc | 30 +++++++++++++ ...Cd1d2_no_weight_reduction_mean_ii_eigen.cc | 30 +++++++++++++ ...weight_reduction_mean_ii_expanded_eigen.cc | 30 +++++++++++++ ...est_nllloss_NCd1d2_reduction_mean_eigen.cc | 30 +++++++++++++ ...ss_NCd1d2_reduction_mean_expanded_eigen.cc | 30 +++++++++++++ ...test_nllloss_NCd1d2_reduction_sum_eigen.cc | 30 +++++++++++++ ...oss_NCd1d2_reduction_sum_expanded_eigen.cc | 30 +++++++++++++ .../test_nllloss_NCd1d2_with_weight_eigen.cc | 31 +++++++++++++ ...lloss_NCd1d2_with_weight_expanded_eigen.cc | 31 +++++++++++++ ...NCd1d2_with_weight_reduction_mean_eigen.cc | 31 +++++++++++++ ...th_weight_reduction_mean_expanded_eigen.cc | 31 +++++++++++++ ..._NCd1d2_with_weight_reduction_sum_eigen.cc | 31 +++++++++++++ ...ith_weight_reduction_sum_expanded_eigen.cc | 31 +++++++++++++ ...d1d2_with_weight_reduction_sum_ii_eigen.cc | 31 +++++++++++++ ..._weight_reduction_sum_ii_expanded_eigen.cc | 31 +++++++++++++ ...d1d2d3_none_no_weight_negative_ii_eigen.cc | 30 +++++++++++++ ...ne_no_weight_negative_ii_expanded_eigen.cc | 30 +++++++++++++ ...lloss_NCd1d2d3_sum_weight_high_ii_eigen.cc | 31 +++++++++++++ ...1d2d3_sum_weight_high_ii_expanded_eigen.cc | 31 +++++++++++++ ..._nllloss_NCd1d2d3d4d5_mean_weight_eigen.cc | 31 +++++++++++++ ...NCd1d2d3d4d5_mean_weight_expanded_eigen.cc | 31 +++++++++++++ ...lloss_NCd1d2d3d4d5_none_no_weight_eigen.cc | 30 +++++++++++++ ...1d2d3d4d5_none_no_weight_expanded_eigen.cc | 30 +++++++++++++ .../test_onehot_negative_indices_eigen.cc | 31 +++++++++++++ .../test_onehot_with_negative_axis_eigen.cc | 31 +++++++++++++ .../test_pow_types_float32_int32_eigen.cc | 30 +++++++++++++ .../test_pow_types_float32_int64_eigen.cc | 30 +++++++++++++ .../test_pow_types_float32_uint32_eigen.cc | 30 +++++++++++++ .../test_pow_types_float32_uint64_eigen.cc | 30 +++++++++++++ .../test_eigen/test_pow_types_float_eigen.cc | 30 +++++++++++++ .../test_pow_types_int32_float32_eigen.cc | 30 +++++++++++++ .../test_pow_types_int32_int32_eigen.cc | 30 +++++++++++++ .../test_pow_types_int64_float32_eigen.cc | 30 +++++++++++++ .../test_pow_types_int64_int64_eigen.cc | 30 +++++++++++++ .../test_eigen/test_pow_types_int_eigen.cc | 30 +++++++++++++ .../test_quantizelinear_axis_eigen.cc | 31 +++++++++++++ ...t_range_float_type_positive_delta_eigen.cc | 31 +++++++++++++ ...loat_type_positive_delta_expanded_eigen.cc | 31 +++++++++++++ ...t_range_int32_type_negative_delta_eigen.cc | 31 +++++++++++++ ...nt32_type_negative_delta_expanded_eigen.cc | 31 +++++++++++++ ...1_negative_axes_keep_dims_example_eigen.cc | 29 +++++++++++++ ...l1_negative_axes_keep_dims_random_eigen.cc | 29 +++++++++++++ ...2_negative_axes_keep_dims_example_eigen.cc | 29 +++++++++++++ ...l2_negative_axes_keep_dims_random_eigen.cc | 29 +++++++++++++ ...xp_negative_axes_keepdims_example_eigen.cc | 29 +++++++++++++ ...exp_negative_axes_keepdims_random_eigen.cc | 29 +++++++++++++ ...test_reduce_log_sum_negative_axes_eigen.cc | 29 +++++++++++++ ...ax_negative_axes_keepdims_example_eigen.cc | 29 +++++++++++++ ...max_negative_axes_keepdims_random_eigen.cc | 29 +++++++++++++ ...an_negative_axes_keepdims_example_eigen.cc | 29 +++++++++++++ ...ean_negative_axes_keepdims_random_eigen.cc | 29 +++++++++++++ ...in_negative_axes_keepdims_example_eigen.cc | 29 +++++++++++++ ...min_negative_axes_keepdims_random_eigen.cc | 29 +++++++++++++ ...od_negative_axes_keepdims_example_eigen.cc | 29 +++++++++++++ ...rod_negative_axes_keepdims_random_eigen.cc | 29 +++++++++++++ ...sum_empty_axes_input_noop_example_eigen.cc | 30 +++++++++++++ ..._sum_empty_axes_input_noop_random_eigen.cc | 30 +++++++++++++ ...um_negative_axes_keepdims_example_eigen.cc | 30 +++++++++++++ ...sum_negative_axes_keepdims_random_eigen.cc | 30 +++++++++++++ ...re_negative_axes_keepdims_example_eigen.cc | 29 +++++++++++++ ...are_negative_axes_keepdims_random_eigen.cc | 29 +++++++++++++ ...st_reshape_negative_extended_dims_eigen.cc | 30 +++++++++++++ .../test_reshape_reordered_all_dims_eigen.cc | 30 +++++++++++++ .../test_reshape_reordered_last_dims_eigen.cc | 30 +++++++++++++ ...est_reshape_zero_and_negative_dim_eigen.cc | 30 +++++++++++++ .../test_eigen/test_reshape_zero_dim_eigen.cc | 30 +++++++++++++ ...ales_cubic_A_n0p5_exclude_outside_eigen.cc | 30 +++++++++++++ ...sample_scales_cubic_align_corners_eigen.cc | 30 +++++++++++++ ...st_resize_downsample_scales_cubic_eigen.cc | 30 +++++++++++++ ...ample_scales_linear_align_corners_eigen.cc | 30 +++++++++++++ ...t_resize_downsample_scales_linear_eigen.cc | 30 +++++++++++++ ..._resize_downsample_scales_nearest_eigen.cc | 30 +++++++++++++ ...est_resize_downsample_sizes_cubic_eigen.cc | 30 +++++++++++++ ...e_sizes_linear_pytorch_half_pixel_eigen.cc | 30 +++++++++++++ ...t_resize_downsample_sizes_nearest_eigen.cc | 30 +++++++++++++ ...izes_nearest_tf_half_pixel_for_nn_eigen.cc | 32 ++++++++++++++ .../test_resize_tf_crop_and_resize_eigen.cc | 31 +++++++++++++ ...ales_cubic_A_n0p5_exclude_outside_eigen.cc | 30 +++++++++++++ ...sample_scales_cubic_align_corners_eigen.cc | 30 +++++++++++++ ..._upsample_scales_cubic_asymmetric_eigen.cc | 30 +++++++++++++ ...test_resize_upsample_scales_cubic_eigen.cc | 30 +++++++++++++ ...ample_scales_linear_align_corners_eigen.cc | 30 +++++++++++++ ...est_resize_upsample_scales_linear_eigen.cc | 30 +++++++++++++ ...st_resize_upsample_scales_nearest_eigen.cc | 30 +++++++++++++ .../test_resize_upsample_sizes_cubic_eigen.cc | 30 +++++++++++++ ...ple_sizes_nearest_ceil_half_pixel_eigen.cc | 30 +++++++++++++ ...est_resize_upsample_sizes_nearest_eigen.cc | 30 +++++++++++++ ...sizes_nearest_floor_align_corners_eigen.cc | 30 +++++++++++++ ...rest_round_prefer_ceil_asymmetric_eigen.cc | 30 +++++++++++++ .../lit_cases/test_eigen/test_round_eigen.cc | 29 +++++++++++++ .../test_scatter_elements_with_axis_eigen.cc | 31 +++++++++++++ ...er_elements_with_negative_indices_eigen.cc | 31 +++++++++++++ ...est_scatter_elements_without_axis_eigen.cc | 31 +++++++++++++ .../test_eigen/test_scatternd_eigen.cc | 31 +++++++++++++ ..._sce_NCd1_mean_weight_negative_ii_eigen.cc | 31 +++++++++++++ ..._mean_weight_negative_ii_expanded_eigen.cc | 31 +++++++++++++ ..._mean_weight_negative_ii_log_prob_eigen.cc | 32 ++++++++++++++ ...ght_negative_ii_log_prob_expanded_eigen.cc | 32 ++++++++++++++ ...d1d2d3_none_no_weight_negative_ii_eigen.cc | 30 +++++++++++++ ...ne_no_weight_negative_ii_expanded_eigen.cc | 30 +++++++++++++ ...ne_no_weight_negative_ii_log_prob_eigen.cc | 31 +++++++++++++ ...ght_negative_ii_log_prob_expanded_eigen.cc | 31 +++++++++++++ ...t_sce_NCd1d2d3_sum_weight_high_ii_eigen.cc | 31 +++++++++++++ ...1d2d3_sum_weight_high_ii_expanded_eigen.cc | 31 +++++++++++++ ...1d2d3_sum_weight_high_ii_log_prob_eigen.cc | 32 ++++++++++++++ ..._weight_high_ii_log_prob_expanded_eigen.cc | 32 ++++++++++++++ ...test_sce_NCd1d2d3d4d5_mean_weight_eigen.cc | 31 +++++++++++++ ...NCd1d2d3d4d5_mean_weight_expanded_eigen.cc | 31 +++++++++++++ ...NCd1d2d3d4d5_mean_weight_log_prob_eigen.cc | 32 ++++++++++++++ ...4d5_mean_weight_log_prob_expanded_eigen.cc | 32 ++++++++++++++ ...t_sce_NCd1d2d3d4d5_none_no_weight_eigen.cc | 30 +++++++++++++ ...1d2d3d4d5_none_no_weight_expanded_eigen.cc | 30 +++++++++++++ ...1d2d3d4d5_none_no_weight_log_prob_eigen.cc | 31 +++++++++++++ ..._none_no_weight_log_prob_expanded_eigen.cc | 31 +++++++++++++ .../test_eigen/test_sce_mean_3d_eigen.cc | 30 +++++++++++++ .../test_sce_mean_3d_expanded_eigen.cc | 30 +++++++++++++ .../test_sce_mean_3d_log_prob_eigen.cc | 31 +++++++++++++ ...est_sce_mean_3d_log_prob_expanded_eigen.cc | 31 +++++++++++++ .../test_eigen/test_sce_mean_eigen.cc | 30 +++++++++++++ .../test_sce_mean_expanded_eigen.cc | 30 +++++++++++++ .../test_sce_mean_log_prob_eigen.cc | 31 +++++++++++++ .../test_sce_mean_log_prob_expanded_eigen.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_3d_eigen.cc | 30 +++++++++++++ ...sce_mean_no_weight_ii_3d_expanded_eigen.cc | 30 +++++++++++++ ...sce_mean_no_weight_ii_3d_log_prob_eigen.cc | 31 +++++++++++++ ...no_weight_ii_3d_log_prob_expanded_eigen.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_4d_eigen.cc | 30 +++++++++++++ ...sce_mean_no_weight_ii_4d_expanded_eigen.cc | 30 +++++++++++++ ...sce_mean_no_weight_ii_4d_log_prob_eigen.cc | 31 +++++++++++++ ...no_weight_ii_4d_log_prob_expanded_eigen.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_eigen.cc | 30 +++++++++++++ ...st_sce_mean_no_weight_ii_expanded_eigen.cc | 30 +++++++++++++ ...st_sce_mean_no_weight_ii_log_prob_eigen.cc | 31 +++++++++++++ ...an_no_weight_ii_log_prob_expanded_eigen.cc | 31 +++++++++++++ .../test_eigen/test_sce_mean_weight_eigen.cc | 31 +++++++++++++ .../test_sce_mean_weight_expanded_eigen.cc | 31 +++++++++++++ .../test_sce_mean_weight_ii_3d_eigen.cc | 31 +++++++++++++ ...st_sce_mean_weight_ii_3d_expanded_eigen.cc | 31 +++++++++++++ ...st_sce_mean_weight_ii_3d_log_prob_eigen.cc | 32 ++++++++++++++ ...an_weight_ii_3d_log_prob_expanded_eigen.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_4d_eigen.cc | 31 +++++++++++++ ...st_sce_mean_weight_ii_4d_expanded_eigen.cc | 31 +++++++++++++ ...st_sce_mean_weight_ii_4d_log_prob_eigen.cc | 32 ++++++++++++++ ...an_weight_ii_4d_log_prob_expanded_eigen.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_eigen.cc | 31 +++++++++++++ .../test_sce_mean_weight_ii_expanded_eigen.cc | 31 +++++++++++++ .../test_sce_mean_weight_ii_log_prob_eigen.cc | 32 ++++++++++++++ ..._mean_weight_ii_log_prob_expanded_eigen.cc | 32 ++++++++++++++ .../test_sce_mean_weight_log_prob_eigen.cc | 32 ++++++++++++++ ...sce_mean_weight_log_prob_expanded_eigen.cc | 32 ++++++++++++++ .../test_eigen/test_sce_none_eigen.cc | 30 +++++++++++++ .../test_sce_none_expanded_eigen.cc | 30 +++++++++++++ .../test_sce_none_log_prob_eigen.cc | 31 +++++++++++++ .../test_sce_none_log_prob_expanded_eigen.cc | 31 +++++++++++++ .../test_eigen/test_sce_none_weights_eigen.cc | 31 +++++++++++++ .../test_sce_none_weights_expanded_eigen.cc | 31 +++++++++++++ .../test_sce_none_weights_log_prob_eigen.cc | 32 ++++++++++++++ ...ce_none_weights_log_prob_expanded_eigen.cc | 32 ++++++++++++++ .../test_eigen/test_sce_sum_eigen.cc | 30 +++++++++++++ .../test_eigen/test_sce_sum_expanded_eigen.cc | 30 +++++++++++++ .../test_eigen/test_sce_sum_log_prob_eigen.cc | 31 +++++++++++++ .../test_sce_sum_log_prob_expanded_eigen.cc | 31 +++++++++++++ .../test_sequence_insert_at_back_eigen.cc | 30 +++++++++++++ .../test_sequence_insert_at_front_eigen.cc | 31 +++++++++++++ .../test_slice_negative_axes_eigen.cc | 32 ++++++++++++++ .../test_softmax_axis_0_expanded_eigen.cc | 29 +++++++++++++ .../test_softmax_axis_1_expanded_eigen.cc | 29 +++++++++++++ .../test_softmax_axis_2_expanded_eigen.cc | 29 +++++++++++++ ...est_softmax_default_axis_expanded_eigen.cc | 29 +++++++++++++ .../test_softmax_example_expanded_eigen.cc | 29 +++++++++++++ ...est_softmax_large_number_expanded_eigen.cc | 29 +++++++++++++ .../test_softmax_negative_axis_eigen.cc | 29 +++++++++++++ ...st_softmax_negative_axis_expanded_eigen.cc | 29 +++++++++++++ .../test_split_zero_size_splits_eigen.cc | 32 ++++++++++++++ .../test_squeeze_negative_axes_eigen.cc | 30 +++++++++++++ .../test_top_k_negative_axis_eigen.cc | 31 +++++++++++++ .../test_eigen/test_top_k_smallest_eigen.cc | 31 +++++++++++++ .../test_training_dropout_default_eigen.cc | 31 +++++++++++++ ...est_training_dropout_default_mask_eigen.cc | 32 ++++++++++++++ .../test_eigen/test_training_dropout_eigen.cc | 31 +++++++++++++ .../test_training_dropout_mask_eigen.cc | 32 ++++++++++++++ .../test_training_dropout_zero_ratio_eigen.cc | 31 +++++++++++++ ..._training_dropout_zero_ratio_mask_eigen.cc | 32 ++++++++++++++ ...st_unique_not_sorted_without_axis_eigen.cc | 32 ++++++++++++++ .../test_unique_sorted_with_axis_3d_eigen.cc | 32 ++++++++++++++ .../test_unique_sorted_with_axis_eigen.cc | 32 ++++++++++++++ ..._unique_sorted_with_negative_axis_eigen.cc | 32 ++++++++++++++ .../test_unique_sorted_without_axis_eigen.cc | 32 ++++++++++++++ .../test_eigen/test_unsqueeze_axis_0_eigen.cc | 30 +++++++++++++ .../test_eigen/test_unsqueeze_axis_1_eigen.cc | 30 +++++++++++++ .../test_eigen/test_unsqueeze_axis_2_eigen.cc | 30 +++++++++++++ .../test_eigen/test_unsqueeze_axis_3_eigen.cc | 29 +++++++++++++ .../test_unsqueeze_negative_axes_eigen.cc | 30 +++++++++++++ .../test_unsqueeze_three_axes_eigen.cc | 30 +++++++++++++ .../test_unsqueeze_two_axes_eigen.cc | 30 +++++++++++++ .../test_unsqueeze_unsorted_axes_eigen.cc | 30 +++++++++++++ .../test_where_long_example_eigen.cc | 31 +++++++++++++ .../test_adagrad_multiple_popart.cc | 39 +++++++++++++++++ .../test_popart/test_adagrad_popart.cc | 34 +++++++++++++++ .../test_popart/test_adam_multiple_popart.cc | 43 +++++++++++++++++++ .../lit_cases/test_popart/test_adam_popart.cc | 36 ++++++++++++++++ ...t_axis_example_select_last_index_popart.cc | 29 +++++++++++++ ...lt_axis_random_select_last_index_popart.cc | 29 +++++++++++++ ...epdims_example_select_last_index_popart.cc | 29 +++++++++++++ ...eepdims_random_select_last_index_popart.cc | 29 +++++++++++++ ...x_negative_axis_keepdims_example_popart.cc | 29 +++++++++++++ ...epdims_example_select_last_index_popart.cc | 29 +++++++++++++ ...ax_negative_axis_keepdims_random_popart.cc | 29 +++++++++++++ ...eepdims_random_select_last_index_popart.cc | 29 +++++++++++++ ...epdims_example_select_last_index_popart.cc | 29 +++++++++++++ ...eepdims_random_select_last_index_popart.cc | 29 +++++++++++++ ...t_axis_example_select_last_index_popart.cc | 29 +++++++++++++ ...lt_axis_random_select_last_index_popart.cc | 29 +++++++++++++ ...epdims_example_select_last_index_popart.cc | 29 +++++++++++++ ...eepdims_random_select_last_index_popart.cc | 29 +++++++++++++ ...n_negative_axis_keepdims_example_popart.cc | 29 +++++++++++++ ...epdims_example_select_last_index_popart.cc | 29 +++++++++++++ ...in_negative_axis_keepdims_random_popart.cc | 29 +++++++++++++ ...eepdims_random_select_last_index_popart.cc | 29 +++++++++++++ ...epdims_example_select_last_index_popart.cc | 29 +++++++++++++ ...eepdims_random_select_last_index_popart.cc | 29 +++++++++++++ .../test_bitshift_left_uint16_popart.cc | 30 +++++++++++++ .../test_bitshift_left_uint32_popart.cc | 30 +++++++++++++ .../test_bitshift_left_uint64_popart.cc | 30 +++++++++++++ .../test_bitshift_left_uint8_popart.cc | 30 +++++++++++++ .../test_bitshift_right_uint16_popart.cc | 30 +++++++++++++ .../test_bitshift_right_uint32_popart.cc | 30 +++++++++++++ .../test_bitshift_right_uint64_popart.cc | 30 +++++++++++++ .../test_bitshift_right_uint8_popart.cc | 30 +++++++++++++ .../test_cast_BFLOAT16_to_FLOAT_popart.cc | 29 +++++++++++++ .../test_cast_FLOAT_to_BFLOAT16_popart.cc | 29 +++++++++++++ .../test_popart/test_celu_expanded_popart.cc | 29 +++++++++++++ .../lit_cases/test_popart/test_celu_popart.cc | 29 +++++++++++++ .../test_clip_default_int8_inbounds_popart.cc | 29 +++++++++++++ .../test_clip_default_int8_max_popart.cc | 30 +++++++++++++ .../test_clip_default_int8_min_popart.cc | 30 +++++++++++++ .../test_compress_negative_axis_popart.cc | 30 +++++++++++++ .../test_concat_1d_axis_negative_1_popart.cc | 30 +++++++++++++ .../test_concat_2d_axis_negative_1_popart.cc | 30 +++++++++++++ .../test_concat_2d_axis_negative_2_popart.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_1_popart.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_2_popart.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_3_popart.cc | 30 +++++++++++++ ...t_constantofshape_int_shape_zero_popart.cc | 29 +++++++++++++ .../test_cumsum_1d_exclusive_popart.cc | 30 +++++++++++++ .../test_popart/test_cumsum_1d_popart.cc | 30 +++++++++++++ ...test_cumsum_1d_reverse_exclusive_popart.cc | 30 +++++++++++++ .../test_cumsum_1d_reverse_popart.cc | 30 +++++++++++++ .../test_cumsum_2d_axis_0_popart.cc | 30 +++++++++++++ .../test_cumsum_2d_axis_1_popart.cc | 30 +++++++++++++ .../test_cumsum_2d_negative_axis_popart.cc | 30 +++++++++++++ ...st_depthtospace_crd_mode_example_popart.cc | 29 +++++++++++++ .../test_depthtospace_crd_mode_popart.cc | 29 +++++++++++++ .../test_depthtospace_dcr_mode_popart.cc | 29 +++++++++++++ .../test_dequantizelinear_axis_popart.cc | 31 +++++++++++++ .../test_popart/test_det_2d_popart.cc | 29 +++++++++++++ .../test_popart/test_det_nd_popart.cc | 29 +++++++++++++ .../test_dropout_default_mask_popart.cc | 30 +++++++++++++ .../test_dropout_default_mask_ratio_popart.cc | 31 +++++++++++++ .../test_dropout_default_old_popart.cc | 29 +++++++++++++ .../test_dropout_default_ratio_popart.cc | 30 +++++++++++++ .../test_dropout_random_old_popart.cc | 29 +++++++++++++ ...t_dynamicquantizelinear_expanded_popart.cc | 31 +++++++++++++ ...tizelinear_max_adjusted_expanded_popart.cc | 31 +++++++++++++ ...namicquantizelinear_max_adjusted_popart.cc | 31 +++++++++++++ ...tizelinear_min_adjusted_expanded_popart.cc | 31 +++++++++++++ ...namicquantizelinear_min_adjusted_popart.cc | 31 +++++++++++++ .../test_dynamicquantizelinear_popart.cc | 31 +++++++++++++ .../test_einsum_batch_diagonal_popart.cc | 29 +++++++++++++ .../test_einsum_batch_matmul_popart.cc | 30 +++++++++++++ .../test_einsum_inner_prod_popart.cc | 30 +++++++++++++ .../test_popart/test_einsum_sum_popart.cc | 29 +++++++++++++ .../test_einsum_transpose_popart.cc | 29 +++++++++++++ .../test_flatten_negative_axis1_popart.cc | 29 +++++++++++++ .../test_flatten_negative_axis2_popart.cc | 29 +++++++++++++ .../test_flatten_negative_axis3_popart.cc | 29 +++++++++++++ .../test_flatten_negative_axis4_popart.cc | 29 +++++++++++++ .../test_gather_2d_indices_popart.cc | 30 +++++++++++++ .../test_gather_elements_0_popart.cc | 30 +++++++++++++ .../test_gather_elements_1_popart.cc | 30 +++++++++++++ ...gather_elements_negative_indices_popart.cc | 30 +++++++++++++ .../test_gather_negative_indices_popart.cc | 30 +++++++++++++ .../test_gathernd_example_float32_popart.cc | 30 +++++++++++++ ...athernd_example_int32_batch_dim1_popart.cc | 30 +++++++++++++ .../test_gathernd_example_int32_popart.cc | 30 +++++++++++++ .../test_gemm_all_attributes_popart.cc | 31 +++++++++++++ .../test_popart/test_gemm_alpha_popart.cc | 31 +++++++++++++ .../test_popart/test_gemm_beta_popart.cc | 31 +++++++++++++ .../test_gemm_default_matrix_bias_popart.cc | 31 +++++++++++++ .../test_gemm_default_no_bias_popart.cc | 30 +++++++++++++ .../test_gemm_default_scalar_bias_popart.cc | 31 +++++++++++++ ..._default_single_elem_vector_bias_popart.cc | 31 +++++++++++++ .../test_gemm_default_vector_bias_popart.cc | 31 +++++++++++++ .../test_gemm_default_zero_bias_popart.cc | 31 +++++++++++++ .../test_gemm_transposeA_popart.cc | 31 +++++++++++++ .../test_gemm_transposeB_popart.cc | 31 +++++++++++++ ...est_greater_equal_bcast_expanded_popart.cc | 30 +++++++++++++ .../test_greater_equal_bcast_popart.cc | 30 +++++++++++++ .../test_greater_equal_expanded_popart.cc | 30 +++++++++++++ .../test_popart/test_greater_equal_popart.cc | 30 +++++++++++++ .../test_hardmax_negative_axis_popart.cc | 29 +++++++++++++ .../lit_cases/test_popart/test_if_popart.cc | 29 +++++++++++++ .../test_popart/test_if_seq_popart.cc | 29 +++++++++++++ .../test_less_equal_bcast_expanded_popart.cc | 30 +++++++++++++ .../test_less_equal_bcast_popart.cc | 30 +++++++++++++ .../test_less_equal_expanded_popart.cc | 30 +++++++++++++ .../test_popart/test_less_equal_popart.cc | 30 +++++++++++++ .../test_logsoftmax_axis_0_expanded_popart.cc | 29 +++++++++++++ .../test_logsoftmax_axis_1_expanded_popart.cc | 29 +++++++++++++ .../test_logsoftmax_axis_2_expanded_popart.cc | 29 +++++++++++++ ...logsoftmax_default_axis_expanded_popart.cc | 29 +++++++++++++ ...st_logsoftmax_example_1_expanded_popart.cc | 29 +++++++++++++ ...logsoftmax_large_number_expanded_popart.cc | 29 +++++++++++++ ...ogsoftmax_negative_axis_expanded_popart.cc | 29 +++++++++++++ .../test_logsoftmax_negative_axis_popart.cc | 29 +++++++++++++ .../test_popart/test_loop11_popart.cc | 32 ++++++++++++++ .../test_popart/test_loop13_seq_popart.cc | 31 +++++++++++++ .../test_popart/test_max_float16_popart.cc | 30 +++++++++++++ .../test_popart/test_max_float32_popart.cc | 30 +++++++++++++ .../test_popart/test_max_float64_popart.cc | 30 +++++++++++++ .../test_popart/test_max_int16_popart.cc | 30 +++++++++++++ .../test_popart/test_max_int32_popart.cc | 30 +++++++++++++ .../test_popart/test_max_int64_popart.cc | 30 +++++++++++++ .../test_popart/test_max_int8_popart.cc | 30 +++++++++++++ .../test_popart/test_max_uint16_popart.cc | 30 +++++++++++++ .../test_popart/test_max_uint32_popart.cc | 30 +++++++++++++ .../test_popart/test_max_uint64_popart.cc | 30 +++++++++++++ .../test_popart/test_max_uint8_popart.cc | 30 +++++++++++++ .../test_maxpool_2d_uint8_popart.cc | 29 +++++++++++++ .../test_popart/test_min_float16_popart.cc | 30 +++++++++++++ .../test_popart/test_min_float32_popart.cc | 30 +++++++++++++ .../test_popart/test_min_float64_popart.cc | 30 +++++++++++++ .../test_popart/test_min_int16_popart.cc | 30 +++++++++++++ .../test_popart/test_min_int32_popart.cc | 30 +++++++++++++ .../test_popart/test_min_int64_popart.cc | 30 +++++++++++++ .../test_popart/test_min_int8_popart.cc | 30 +++++++++++++ .../test_popart/test_min_uint16_popart.cc | 30 +++++++++++++ .../test_popart/test_min_uint32_popart.cc | 30 +++++++++++++ .../test_popart/test_min_uint64_popart.cc | 30 +++++++++++++ .../test_popart/test_min_uint8_popart.cc | 30 +++++++++++++ .../test_popart/test_mod_broadcast_popart.cc | 30 +++++++++++++ .../test_popart/test_mod_int64_fmod_popart.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float16_popart.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float32_popart.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float64_popart.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int16_popart.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int32_popart.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int64_popart.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int8_popart.cc | 30 +++++++++++++ .../test_popart/test_mod_uint16_popart.cc | 30 +++++++++++++ .../test_popart/test_mod_uint32_popart.cc | 30 +++++++++++++ .../test_popart/test_mod_uint64_popart.cc | 30 +++++++++++++ .../test_popart/test_mod_uint8_popart.cc | 30 +++++++++++++ .../test_momentum_multiple_popart.cc | 39 +++++++++++++++++ .../test_popart/test_momentum_popart.cc | 34 +++++++++++++++ .../test_nesterov_momentum_popart.cc | 34 +++++++++++++++ .../test_nllloss_NC_expanded_popart.cc | 30 +++++++++++++ .../test_popart/test_nllloss_NC_popart.cc | 30 +++++++++++++ .../test_nllloss_NCd1_expanded_popart.cc | 30 +++++++++++++ .../test_nllloss_NCd1_ii_expanded_popart.cc | 30 +++++++++++++ .../test_nllloss_NCd1_ii_popart.cc | 30 +++++++++++++ ...mean_weight_negative_ii_expanded_popart.cc | 31 +++++++++++++ ...oss_NCd1_mean_weight_negative_ii_popart.cc | 31 +++++++++++++ .../test_popart/test_nllloss_NCd1_popart.cc | 30 +++++++++++++ ...est_nllloss_NCd1_weight_expanded_popart.cc | 31 +++++++++++++ ..._nllloss_NCd1_weight_ii_expanded_popart.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_ii_popart.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_popart.cc | 31 +++++++++++++ .../test_nllloss_NCd1d2_expanded_popart.cc | 30 +++++++++++++ ...eight_reduction_mean_ii_expanded_popart.cc | 30 +++++++++++++ ...d1d2_no_weight_reduction_mean_ii_popart.cc | 30 +++++++++++++ .../test_popart/test_nllloss_NCd1d2_popart.cc | 30 +++++++++++++ ...s_NCd1d2_reduction_mean_expanded_popart.cc | 30 +++++++++++++ ...st_nllloss_NCd1d2_reduction_mean_popart.cc | 30 +++++++++++++ ...ss_NCd1d2_reduction_sum_expanded_popart.cc | 30 +++++++++++++ ...est_nllloss_NCd1d2_reduction_sum_popart.cc | 30 +++++++++++++ ...loss_NCd1d2_with_weight_expanded_popart.cc | 31 +++++++++++++ .../test_nllloss_NCd1d2_with_weight_popart.cc | 31 +++++++++++++ ...h_weight_reduction_mean_expanded_popart.cc | 31 +++++++++++++ ...Cd1d2_with_weight_reduction_mean_popart.cc | 31 +++++++++++++ ...th_weight_reduction_sum_expanded_popart.cc | 31 +++++++++++++ ...weight_reduction_sum_ii_expanded_popart.cc | 31 +++++++++++++ ...1d2_with_weight_reduction_sum_ii_popart.cc | 31 +++++++++++++ ...NCd1d2_with_weight_reduction_sum_popart.cc | 31 +++++++++++++ ...e_no_weight_negative_ii_expanded_popart.cc | 30 +++++++++++++ ...1d2d3_none_no_weight_negative_ii_popart.cc | 30 +++++++++++++ ...d2d3_sum_weight_high_ii_expanded_popart.cc | 31 +++++++++++++ ...loss_NCd1d2d3_sum_weight_high_ii_popart.cc | 31 +++++++++++++ ...Cd1d2d3d4d5_mean_weight_expanded_popart.cc | 31 +++++++++++++ ...nllloss_NCd1d2d3d4d5_mean_weight_popart.cc | 31 +++++++++++++ ...d2d3d4d5_none_no_weight_expanded_popart.cc | 30 +++++++++++++ ...loss_NCd1d2d3d4d5_none_no_weight_popart.cc | 30 +++++++++++++ .../test_onehot_negative_indices_popart.cc | 31 +++++++++++++ .../test_onehot_with_negative_axis_popart.cc | 31 +++++++++++++ .../test_pow_types_float32_int32_popart.cc | 30 +++++++++++++ .../test_pow_types_float32_int64_popart.cc | 30 +++++++++++++ .../test_pow_types_float32_uint32_popart.cc | 30 +++++++++++++ .../test_pow_types_float32_uint64_popart.cc | 30 +++++++++++++ .../test_pow_types_float_popart.cc | 30 +++++++++++++ .../test_pow_types_int32_float32_popart.cc | 30 +++++++++++++ .../test_pow_types_int32_int32_popart.cc | 30 +++++++++++++ .../test_pow_types_int64_float32_popart.cc | 30 +++++++++++++ .../test_pow_types_int64_int64_popart.cc | 30 +++++++++++++ .../test_popart/test_pow_types_int_popart.cc | 30 +++++++++++++ .../test_quantizelinear_axis_popart.cc | 31 +++++++++++++ ...oat_type_positive_delta_expanded_popart.cc | 31 +++++++++++++ ..._range_float_type_positive_delta_popart.cc | 31 +++++++++++++ ...t32_type_negative_delta_expanded_popart.cc | 31 +++++++++++++ ..._range_int32_type_negative_delta_popart.cc | 31 +++++++++++++ ..._negative_axes_keep_dims_example_popart.cc | 29 +++++++++++++ ...1_negative_axes_keep_dims_random_popart.cc | 29 +++++++++++++ ..._negative_axes_keep_dims_example_popart.cc | 29 +++++++++++++ ...2_negative_axes_keep_dims_random_popart.cc | 29 +++++++++++++ ...p_negative_axes_keepdims_example_popart.cc | 29 +++++++++++++ ...xp_negative_axes_keepdims_random_popart.cc | 29 +++++++++++++ ...est_reduce_log_sum_negative_axes_popart.cc | 29 +++++++++++++ ...x_negative_axes_keepdims_example_popart.cc | 29 +++++++++++++ ...ax_negative_axes_keepdims_random_popart.cc | 29 +++++++++++++ ...n_negative_axes_keepdims_example_popart.cc | 29 +++++++++++++ ...an_negative_axes_keepdims_random_popart.cc | 29 +++++++++++++ ...n_negative_axes_keepdims_example_popart.cc | 29 +++++++++++++ ...in_negative_axes_keepdims_random_popart.cc | 29 +++++++++++++ ...d_negative_axes_keepdims_example_popart.cc | 29 +++++++++++++ ...od_negative_axes_keepdims_random_popart.cc | 29 +++++++++++++ ...um_empty_axes_input_noop_example_popart.cc | 30 +++++++++++++ ...sum_empty_axes_input_noop_random_popart.cc | 30 +++++++++++++ ...m_negative_axes_keepdims_example_popart.cc | 30 +++++++++++++ ...um_negative_axes_keepdims_random_popart.cc | 30 +++++++++++++ ...e_negative_axes_keepdims_example_popart.cc | 29 +++++++++++++ ...re_negative_axes_keepdims_random_popart.cc | 29 +++++++++++++ ...t_reshape_negative_extended_dims_popart.cc | 30 +++++++++++++ .../test_reshape_reordered_all_dims_popart.cc | 30 +++++++++++++ ...test_reshape_reordered_last_dims_popart.cc | 30 +++++++++++++ ...st_reshape_zero_and_negative_dim_popart.cc | 30 +++++++++++++ .../test_reshape_zero_dim_popart.cc | 30 +++++++++++++ ...les_cubic_A_n0p5_exclude_outside_popart.cc | 30 +++++++++++++ ...ample_scales_cubic_align_corners_popart.cc | 30 +++++++++++++ ...t_resize_downsample_scales_cubic_popart.cc | 30 +++++++++++++ ...mple_scales_linear_align_corners_popart.cc | 30 +++++++++++++ ..._resize_downsample_scales_linear_popart.cc | 30 +++++++++++++ ...resize_downsample_scales_nearest_popart.cc | 30 +++++++++++++ ...st_resize_downsample_sizes_cubic_popart.cc | 30 +++++++++++++ ..._sizes_linear_pytorch_half_pixel_popart.cc | 30 +++++++++++++ ..._resize_downsample_sizes_nearest_popart.cc | 30 +++++++++++++ ...zes_nearest_tf_half_pixel_for_nn_popart.cc | 32 ++++++++++++++ .../test_resize_tf_crop_and_resize_popart.cc | 31 +++++++++++++ ...les_cubic_A_n0p5_exclude_outside_popart.cc | 30 +++++++++++++ ...ample_scales_cubic_align_corners_popart.cc | 30 +++++++++++++ ...upsample_scales_cubic_asymmetric_popart.cc | 30 +++++++++++++ ...est_resize_upsample_scales_cubic_popart.cc | 30 +++++++++++++ ...mple_scales_linear_align_corners_popart.cc | 30 +++++++++++++ ...st_resize_upsample_scales_linear_popart.cc | 30 +++++++++++++ ...t_resize_upsample_scales_nearest_popart.cc | 30 +++++++++++++ ...test_resize_upsample_sizes_cubic_popart.cc | 30 +++++++++++++ ...le_sizes_nearest_ceil_half_pixel_popart.cc | 30 +++++++++++++ ...izes_nearest_floor_align_corners_popart.cc | 30 +++++++++++++ ...st_resize_upsample_sizes_nearest_popart.cc | 30 +++++++++++++ ...est_round_prefer_ceil_asymmetric_popart.cc | 30 +++++++++++++ .../test_popart/test_round_popart.cc | 29 +++++++++++++ .../test_scatter_elements_with_axis_popart.cc | 31 +++++++++++++ ...r_elements_with_negative_indices_popart.cc | 31 +++++++++++++ ...st_scatter_elements_without_axis_popart.cc | 31 +++++++++++++ .../test_popart/test_scatternd_popart.cc | 31 +++++++++++++ ...mean_weight_negative_ii_expanded_popart.cc | 31 +++++++++++++ ...ht_negative_ii_log_prob_expanded_popart.cc | 32 ++++++++++++++ ...mean_weight_negative_ii_log_prob_popart.cc | 32 ++++++++++++++ ...sce_NCd1_mean_weight_negative_ii_popart.cc | 31 +++++++++++++ ...e_no_weight_negative_ii_expanded_popart.cc | 30 +++++++++++++ ...ht_negative_ii_log_prob_expanded_popart.cc | 31 +++++++++++++ ...e_no_weight_negative_ii_log_prob_popart.cc | 31 +++++++++++++ ...1d2d3_none_no_weight_negative_ii_popart.cc | 30 +++++++++++++ ...d2d3_sum_weight_high_ii_expanded_popart.cc | 31 +++++++++++++ ...weight_high_ii_log_prob_expanded_popart.cc | 32 ++++++++++++++ ...d2d3_sum_weight_high_ii_log_prob_popart.cc | 32 ++++++++++++++ ..._sce_NCd1d2d3_sum_weight_high_ii_popart.cc | 31 +++++++++++++ ...Cd1d2d3d4d5_mean_weight_expanded_popart.cc | 31 +++++++++++++ ...d5_mean_weight_log_prob_expanded_popart.cc | 32 ++++++++++++++ ...Cd1d2d3d4d5_mean_weight_log_prob_popart.cc | 32 ++++++++++++++ ...est_sce_NCd1d2d3d4d5_mean_weight_popart.cc | 31 +++++++++++++ ...d2d3d4d5_none_no_weight_expanded_popart.cc | 30 +++++++++++++ ...none_no_weight_log_prob_expanded_popart.cc | 31 +++++++++++++ ...d2d3d4d5_none_no_weight_log_prob_popart.cc | 31 +++++++++++++ ..._sce_NCd1d2d3d4d5_none_no_weight_popart.cc | 30 +++++++++++++ .../test_sce_mean_3d_expanded_popart.cc | 30 +++++++++++++ ...st_sce_mean_3d_log_prob_expanded_popart.cc | 31 +++++++++++++ .../test_sce_mean_3d_log_prob_popart.cc | 31 +++++++++++++ .../test_popart/test_sce_mean_3d_popart.cc | 30 +++++++++++++ .../test_sce_mean_expanded_popart.cc | 30 +++++++++++++ .../test_sce_mean_log_prob_expanded_popart.cc | 31 +++++++++++++ .../test_sce_mean_log_prob_popart.cc | 31 +++++++++++++ ...ce_mean_no_weight_ii_3d_expanded_popart.cc | 30 +++++++++++++ ...o_weight_ii_3d_log_prob_expanded_popart.cc | 31 +++++++++++++ ...ce_mean_no_weight_ii_3d_log_prob_popart.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_3d_popart.cc | 30 +++++++++++++ ...ce_mean_no_weight_ii_4d_expanded_popart.cc | 30 +++++++++++++ ...o_weight_ii_4d_log_prob_expanded_popart.cc | 31 +++++++++++++ ...ce_mean_no_weight_ii_4d_log_prob_popart.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_4d_popart.cc | 30 +++++++++++++ ...t_sce_mean_no_weight_ii_expanded_popart.cc | 30 +++++++++++++ ...n_no_weight_ii_log_prob_expanded_popart.cc | 31 +++++++++++++ ...t_sce_mean_no_weight_ii_log_prob_popart.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_popart.cc | 30 +++++++++++++ .../test_popart/test_sce_mean_popart.cc | 30 +++++++++++++ .../test_sce_mean_weight_expanded_popart.cc | 31 +++++++++++++ ...t_sce_mean_weight_ii_3d_expanded_popart.cc | 31 +++++++++++++ ...n_weight_ii_3d_log_prob_expanded_popart.cc | 32 ++++++++++++++ ...t_sce_mean_weight_ii_3d_log_prob_popart.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_3d_popart.cc | 31 +++++++++++++ ...t_sce_mean_weight_ii_4d_expanded_popart.cc | 31 +++++++++++++ ...n_weight_ii_4d_log_prob_expanded_popart.cc | 32 ++++++++++++++ ...t_sce_mean_weight_ii_4d_log_prob_popart.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_4d_popart.cc | 31 +++++++++++++ ...test_sce_mean_weight_ii_expanded_popart.cc | 31 +++++++++++++ ...mean_weight_ii_log_prob_expanded_popart.cc | 32 ++++++++++++++ ...test_sce_mean_weight_ii_log_prob_popart.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_popart.cc | 31 +++++++++++++ ...ce_mean_weight_log_prob_expanded_popart.cc | 32 ++++++++++++++ .../test_sce_mean_weight_log_prob_popart.cc | 32 ++++++++++++++ .../test_sce_mean_weight_popart.cc | 31 +++++++++++++ .../test_sce_none_expanded_popart.cc | 30 +++++++++++++ .../test_sce_none_log_prob_expanded_popart.cc | 31 +++++++++++++ .../test_sce_none_log_prob_popart.cc | 31 +++++++++++++ .../test_popart/test_sce_none_popart.cc | 30 +++++++++++++ .../test_sce_none_weights_expanded_popart.cc | 31 +++++++++++++ ...e_none_weights_log_prob_expanded_popart.cc | 32 ++++++++++++++ .../test_sce_none_weights_log_prob_popart.cc | 32 ++++++++++++++ .../test_sce_none_weights_popart.cc | 31 +++++++++++++ .../test_sce_sum_expanded_popart.cc | 30 +++++++++++++ .../test_sce_sum_log_prob_expanded_popart.cc | 31 +++++++++++++ .../test_sce_sum_log_prob_popart.cc | 31 +++++++++++++ .../test_popart/test_sce_sum_popart.cc | 30 +++++++++++++ .../test_sequence_insert_at_back_popart.cc | 30 +++++++++++++ .../test_sequence_insert_at_front_popart.cc | 31 +++++++++++++ .../test_slice_negative_axes_popart.cc | 32 ++++++++++++++ .../test_softmax_axis_0_expanded_popart.cc | 29 +++++++++++++ .../test_softmax_axis_1_expanded_popart.cc | 29 +++++++++++++ .../test_softmax_axis_2_expanded_popart.cc | 29 +++++++++++++ ...st_softmax_default_axis_expanded_popart.cc | 29 +++++++++++++ .../test_softmax_example_expanded_popart.cc | 29 +++++++++++++ ...st_softmax_large_number_expanded_popart.cc | 29 +++++++++++++ ...t_softmax_negative_axis_expanded_popart.cc | 29 +++++++++++++ .../test_softmax_negative_axis_popart.cc | 29 +++++++++++++ .../test_split_zero_size_splits_popart.cc | 32 ++++++++++++++ .../test_squeeze_negative_axes_popart.cc | 30 +++++++++++++ .../test_top_k_negative_axis_popart.cc | 31 +++++++++++++ .../test_popart/test_top_k_smallest_popart.cc | 31 +++++++++++++ ...st_training_dropout_default_mask_popart.cc | 32 ++++++++++++++ .../test_training_dropout_default_popart.cc | 31 +++++++++++++ .../test_training_dropout_mask_popart.cc | 32 ++++++++++++++ .../test_training_dropout_popart.cc | 31 +++++++++++++ ...training_dropout_zero_ratio_mask_popart.cc | 32 ++++++++++++++ ...test_training_dropout_zero_ratio_popart.cc | 31 +++++++++++++ ...t_unique_not_sorted_without_axis_popart.cc | 32 ++++++++++++++ .../test_unique_sorted_with_axis_3d_popart.cc | 32 ++++++++++++++ .../test_unique_sorted_with_axis_popart.cc | 32 ++++++++++++++ ...unique_sorted_with_negative_axis_popart.cc | 32 ++++++++++++++ .../test_unique_sorted_without_axis_popart.cc | 32 ++++++++++++++ .../test_unsqueeze_axis_0_popart.cc | 30 +++++++++++++ .../test_unsqueeze_axis_1_popart.cc | 30 +++++++++++++ .../test_unsqueeze_axis_2_popart.cc | 30 +++++++++++++ .../test_unsqueeze_axis_3_popart.cc | 29 +++++++++++++ .../test_unsqueeze_negative_axes_popart.cc | 30 +++++++++++++ .../test_unsqueeze_three_axes_popart.cc | 30 +++++++++++++ .../test_unsqueeze_two_axes_popart.cc | 30 +++++++++++++ .../test_unsqueeze_unsorted_axes_popart.cc | 30 +++++++++++++ .../test_where_long_example_popart.cc | 31 +++++++++++++ .../test_adagrad_multiple_tensorrt.cc | 39 +++++++++++++++++ .../test_tensorrt/test_adagrad_tensorrt.cc | 34 +++++++++++++++ .../test_adam_multiple_tensorrt.cc | 43 +++++++++++++++++++ .../test_tensorrt/test_adam_tensorrt.cc | 36 ++++++++++++++++ ...axis_example_select_last_index_tensorrt.cc | 29 +++++++++++++ ..._axis_random_select_last_index_tensorrt.cc | 29 +++++++++++++ ...dims_example_select_last_index_tensorrt.cc | 29 +++++++++++++ ...pdims_random_select_last_index_tensorrt.cc | 29 +++++++++++++ ...dims_example_select_last_index_tensorrt.cc | 29 +++++++++++++ ...negative_axis_keepdims_example_tensorrt.cc | 29 +++++++++++++ ...pdims_random_select_last_index_tensorrt.cc | 29 +++++++++++++ ..._negative_axis_keepdims_random_tensorrt.cc | 29 +++++++++++++ ...dims_example_select_last_index_tensorrt.cc | 29 +++++++++++++ ...pdims_random_select_last_index_tensorrt.cc | 29 +++++++++++++ ...axis_example_select_last_index_tensorrt.cc | 29 +++++++++++++ ..._axis_random_select_last_index_tensorrt.cc | 29 +++++++++++++ ...dims_example_select_last_index_tensorrt.cc | 29 +++++++++++++ ...pdims_random_select_last_index_tensorrt.cc | 29 +++++++++++++ ...dims_example_select_last_index_tensorrt.cc | 29 +++++++++++++ ...negative_axis_keepdims_example_tensorrt.cc | 29 +++++++++++++ ...pdims_random_select_last_index_tensorrt.cc | 29 +++++++++++++ ..._negative_axis_keepdims_random_tensorrt.cc | 29 +++++++++++++ ...dims_example_select_last_index_tensorrt.cc | 29 +++++++++++++ ...pdims_random_select_last_index_tensorrt.cc | 29 +++++++++++++ .../test_bitshift_left_uint16_tensorrt.cc | 30 +++++++++++++ .../test_bitshift_left_uint32_tensorrt.cc | 30 +++++++++++++ .../test_bitshift_left_uint64_tensorrt.cc | 30 +++++++++++++ .../test_bitshift_left_uint8_tensorrt.cc | 30 +++++++++++++ .../test_bitshift_right_uint16_tensorrt.cc | 30 +++++++++++++ .../test_bitshift_right_uint32_tensorrt.cc | 30 +++++++++++++ .../test_bitshift_right_uint64_tensorrt.cc | 30 +++++++++++++ .../test_bitshift_right_uint8_tensorrt.cc | 30 +++++++++++++ .../test_cast_BFLOAT16_to_FLOAT_tensorrt.cc | 29 +++++++++++++ .../test_cast_FLOAT_to_BFLOAT16_tensorrt.cc | 29 +++++++++++++ .../test_celu_expanded_tensorrt.cc | 29 +++++++++++++ .../test_tensorrt/test_celu_tensorrt.cc | 29 +++++++++++++ ...est_clip_default_int8_inbounds_tensorrt.cc | 29 +++++++++++++ .../test_clip_default_int8_max_tensorrt.cc | 30 +++++++++++++ .../test_clip_default_int8_min_tensorrt.cc | 30 +++++++++++++ .../test_compress_negative_axis_tensorrt.cc | 30 +++++++++++++ ...test_concat_1d_axis_negative_1_tensorrt.cc | 30 +++++++++++++ ...test_concat_2d_axis_negative_1_tensorrt.cc | 30 +++++++++++++ ...test_concat_2d_axis_negative_2_tensorrt.cc | 30 +++++++++++++ ...test_concat_3d_axis_negative_1_tensorrt.cc | 30 +++++++++++++ ...test_concat_3d_axis_negative_2_tensorrt.cc | 30 +++++++++++++ ...test_concat_3d_axis_negative_3_tensorrt.cc | 30 +++++++++++++ ...constantofshape_int_shape_zero_tensorrt.cc | 29 +++++++++++++ .../test_cumsum_1d_exclusive_tensorrt.cc | 30 +++++++++++++ ...st_cumsum_1d_reverse_exclusive_tensorrt.cc | 30 +++++++++++++ .../test_cumsum_1d_reverse_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_cumsum_1d_tensorrt.cc | 30 +++++++++++++ .../test_cumsum_2d_axis_0_tensorrt.cc | 30 +++++++++++++ .../test_cumsum_2d_axis_1_tensorrt.cc | 30 +++++++++++++ .../test_cumsum_2d_negative_axis_tensorrt.cc | 30 +++++++++++++ ..._depthtospace_crd_mode_example_tensorrt.cc | 29 +++++++++++++ .../test_depthtospace_crd_mode_tensorrt.cc | 29 +++++++++++++ .../test_depthtospace_dcr_mode_tensorrt.cc | 29 +++++++++++++ .../test_dequantizelinear_axis_tensorrt.cc | 31 +++++++++++++ .../test_tensorrt/test_det_2d_tensorrt.cc | 29 +++++++++++++ .../test_tensorrt/test_det_nd_tensorrt.cc | 29 +++++++++++++ ...est_dropout_default_mask_ratio_tensorrt.cc | 31 +++++++++++++ .../test_dropout_default_mask_tensorrt.cc | 30 +++++++++++++ .../test_dropout_default_old_tensorrt.cc | 29 +++++++++++++ .../test_dropout_default_ratio_tensorrt.cc | 30 +++++++++++++ .../test_dropout_random_old_tensorrt.cc | 29 +++++++++++++ ...dynamicquantizelinear_expanded_tensorrt.cc | 31 +++++++++++++ ...zelinear_max_adjusted_expanded_tensorrt.cc | 31 +++++++++++++ ...micquantizelinear_max_adjusted_tensorrt.cc | 31 +++++++++++++ ...zelinear_min_adjusted_expanded_tensorrt.cc | 31 +++++++++++++ ...micquantizelinear_min_adjusted_tensorrt.cc | 31 +++++++++++++ .../test_dynamicquantizelinear_tensorrt.cc | 31 +++++++++++++ .../test_einsum_batch_diagonal_tensorrt.cc | 29 +++++++++++++ .../test_einsum_batch_matmul_tensorrt.cc | 30 +++++++++++++ .../test_einsum_inner_prod_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_einsum_sum_tensorrt.cc | 29 +++++++++++++ .../test_einsum_transpose_tensorrt.cc | 29 +++++++++++++ .../test_flatten_negative_axis1_tensorrt.cc | 29 +++++++++++++ .../test_flatten_negative_axis2_tensorrt.cc | 29 +++++++++++++ .../test_flatten_negative_axis3_tensorrt.cc | 29 +++++++++++++ .../test_flatten_negative_axis4_tensorrt.cc | 29 +++++++++++++ .../test_gather_2d_indices_tensorrt.cc | 30 +++++++++++++ .../test_gather_elements_0_tensorrt.cc | 30 +++++++++++++ .../test_gather_elements_1_tensorrt.cc | 30 +++++++++++++ ...ther_elements_negative_indices_tensorrt.cc | 30 +++++++++++++ .../test_gather_negative_indices_tensorrt.cc | 30 +++++++++++++ .../test_gathernd_example_float32_tensorrt.cc | 30 +++++++++++++ ...hernd_example_int32_batch_dim1_tensorrt.cc | 30 +++++++++++++ .../test_gathernd_example_int32_tensorrt.cc | 30 +++++++++++++ .../test_gemm_all_attributes_tensorrt.cc | 31 +++++++++++++ .../test_tensorrt/test_gemm_alpha_tensorrt.cc | 31 +++++++++++++ .../test_tensorrt/test_gemm_beta_tensorrt.cc | 31 +++++++++++++ .../test_gemm_default_matrix_bias_tensorrt.cc | 31 +++++++++++++ .../test_gemm_default_no_bias_tensorrt.cc | 30 +++++++++++++ .../test_gemm_default_scalar_bias_tensorrt.cc | 31 +++++++++++++ ...efault_single_elem_vector_bias_tensorrt.cc | 31 +++++++++++++ .../test_gemm_default_vector_bias_tensorrt.cc | 31 +++++++++++++ .../test_gemm_default_zero_bias_tensorrt.cc | 31 +++++++++++++ .../test_gemm_transposeA_tensorrt.cc | 31 +++++++++++++ .../test_gemm_transposeB_tensorrt.cc | 31 +++++++++++++ ...t_greater_equal_bcast_expanded_tensorrt.cc | 30 +++++++++++++ .../test_greater_equal_bcast_tensorrt.cc | 30 +++++++++++++ .../test_greater_equal_expanded_tensorrt.cc | 30 +++++++++++++ .../test_greater_equal_tensorrt.cc | 30 +++++++++++++ .../test_hardmax_negative_axis_tensorrt.cc | 29 +++++++++++++ .../test_tensorrt/test_if_seq_tensorrt.cc | 29 +++++++++++++ .../test_tensorrt/test_if_tensorrt.cc | 29 +++++++++++++ ...test_less_equal_bcast_expanded_tensorrt.cc | 30 +++++++++++++ .../test_less_equal_bcast_tensorrt.cc | 30 +++++++++++++ .../test_less_equal_expanded_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_less_equal_tensorrt.cc | 30 +++++++++++++ ...est_logsoftmax_axis_0_expanded_tensorrt.cc | 29 +++++++++++++ ...est_logsoftmax_axis_1_expanded_tensorrt.cc | 29 +++++++++++++ ...est_logsoftmax_axis_2_expanded_tensorrt.cc | 29 +++++++++++++ ...gsoftmax_default_axis_expanded_tensorrt.cc | 29 +++++++++++++ ..._logsoftmax_example_1_expanded_tensorrt.cc | 29 +++++++++++++ ...gsoftmax_large_number_expanded_tensorrt.cc | 29 +++++++++++++ ...softmax_negative_axis_expanded_tensorrt.cc | 29 +++++++++++++ .../test_logsoftmax_negative_axis_tensorrt.cc | 29 +++++++++++++ .../test_tensorrt/test_loop11_tensorrt.cc | 32 ++++++++++++++ .../test_tensorrt/test_loop13_seq_tensorrt.cc | 31 +++++++++++++ .../test_max_float16_tensorrt.cc | 30 +++++++++++++ .../test_max_float32_tensorrt.cc | 30 +++++++++++++ .../test_max_float64_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_max_int16_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_max_int32_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_max_int64_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_max_int8_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_max_uint16_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_max_uint32_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_max_uint64_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_max_uint8_tensorrt.cc | 30 +++++++++++++ .../test_maxpool_2d_uint8_tensorrt.cc | 29 +++++++++++++ .../test_min_float16_tensorrt.cc | 30 +++++++++++++ .../test_min_float32_tensorrt.cc | 30 +++++++++++++ .../test_min_float64_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_min_int16_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_min_int32_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_min_int64_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_min_int8_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_min_uint16_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_min_uint32_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_min_uint64_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_min_uint8_tensorrt.cc | 30 +++++++++++++ .../test_mod_broadcast_tensorrt.cc | 30 +++++++++++++ .../test_mod_int64_fmod_tensorrt.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float16_tensorrt.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float32_tensorrt.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float64_tensorrt.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int16_tensorrt.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int32_tensorrt.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int64_tensorrt.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int8_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_mod_uint16_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_mod_uint32_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_mod_uint64_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_mod_uint8_tensorrt.cc | 30 +++++++++++++ .../test_momentum_multiple_tensorrt.cc | 39 +++++++++++++++++ .../test_tensorrt/test_momentum_tensorrt.cc | 34 +++++++++++++++ .../test_nesterov_momentum_tensorrt.cc | 34 +++++++++++++++ .../test_nllloss_NC_expanded_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_nllloss_NC_tensorrt.cc | 30 +++++++++++++ .../test_nllloss_NCd1_expanded_tensorrt.cc | 30 +++++++++++++ .../test_nllloss_NCd1_ii_expanded_tensorrt.cc | 30 +++++++++++++ .../test_nllloss_NCd1_ii_tensorrt.cc | 30 +++++++++++++ ...an_weight_negative_ii_expanded_tensorrt.cc | 31 +++++++++++++ ...s_NCd1_mean_weight_negative_ii_tensorrt.cc | 31 +++++++++++++ .../test_nllloss_NCd1_tensorrt.cc | 30 +++++++++++++ ...t_nllloss_NCd1_weight_expanded_tensorrt.cc | 31 +++++++++++++ ...llloss_NCd1_weight_ii_expanded_tensorrt.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_ii_tensorrt.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_tensorrt.cc | 31 +++++++++++++ .../test_nllloss_NCd1d2_expanded_tensorrt.cc | 30 +++++++++++++ ...ght_reduction_mean_ii_expanded_tensorrt.cc | 30 +++++++++++++ ...d2_no_weight_reduction_mean_ii_tensorrt.cc | 30 +++++++++++++ ...NCd1d2_reduction_mean_expanded_tensorrt.cc | 30 +++++++++++++ ..._nllloss_NCd1d2_reduction_mean_tensorrt.cc | 30 +++++++++++++ ..._NCd1d2_reduction_sum_expanded_tensorrt.cc | 30 +++++++++++++ ...t_nllloss_NCd1d2_reduction_sum_tensorrt.cc | 30 +++++++++++++ .../test_nllloss_NCd1d2_tensorrt.cc | 30 +++++++++++++ ...ss_NCd1d2_with_weight_expanded_tensorrt.cc | 31 +++++++++++++ ...weight_reduction_mean_expanded_tensorrt.cc | 31 +++++++++++++ ...1d2_with_weight_reduction_mean_tensorrt.cc | 31 +++++++++++++ ..._weight_reduction_sum_expanded_tensorrt.cc | 31 +++++++++++++ ...ight_reduction_sum_ii_expanded_tensorrt.cc | 31 +++++++++++++ ...2_with_weight_reduction_sum_ii_tensorrt.cc | 31 +++++++++++++ ...d1d2_with_weight_reduction_sum_tensorrt.cc | 31 +++++++++++++ ...est_nllloss_NCd1d2_with_weight_tensorrt.cc | 31 +++++++++++++ ...no_weight_negative_ii_expanded_tensorrt.cc | 30 +++++++++++++ ...2d3_none_no_weight_negative_ii_tensorrt.cc | 30 +++++++++++++ ...d3_sum_weight_high_ii_expanded_tensorrt.cc | 31 +++++++++++++ ...ss_NCd1d2d3_sum_weight_high_ii_tensorrt.cc | 31 +++++++++++++ ...1d2d3d4d5_mean_weight_expanded_tensorrt.cc | 31 +++++++++++++ ...lloss_NCd1d2d3d4d5_mean_weight_tensorrt.cc | 31 +++++++++++++ ...d3d4d5_none_no_weight_expanded_tensorrt.cc | 30 +++++++++++++ ...ss_NCd1d2d3d4d5_none_no_weight_tensorrt.cc | 30 +++++++++++++ .../test_onehot_negative_indices_tensorrt.cc | 31 +++++++++++++ ...test_onehot_with_negative_axis_tensorrt.cc | 31 +++++++++++++ .../test_pow_types_float32_int32_tensorrt.cc | 30 +++++++++++++ .../test_pow_types_float32_int64_tensorrt.cc | 30 +++++++++++++ .../test_pow_types_float32_uint32_tensorrt.cc | 30 +++++++++++++ .../test_pow_types_float32_uint64_tensorrt.cc | 30 +++++++++++++ .../test_pow_types_float_tensorrt.cc | 30 +++++++++++++ .../test_pow_types_int32_float32_tensorrt.cc | 30 +++++++++++++ .../test_pow_types_int32_int32_tensorrt.cc | 30 +++++++++++++ .../test_pow_types_int64_float32_tensorrt.cc | 30 +++++++++++++ .../test_pow_types_int64_int64_tensorrt.cc | 30 +++++++++++++ .../test_pow_types_int_tensorrt.cc | 30 +++++++++++++ .../test_quantizelinear_axis_tensorrt.cc | 31 +++++++++++++ ...t_type_positive_delta_expanded_tensorrt.cc | 31 +++++++++++++ ...ange_float_type_positive_delta_tensorrt.cc | 31 +++++++++++++ ...2_type_negative_delta_expanded_tensorrt.cc | 31 +++++++++++++ ...ange_int32_type_negative_delta_tensorrt.cc | 31 +++++++++++++ ...egative_axes_keep_dims_example_tensorrt.cc | 29 +++++++++++++ ...negative_axes_keep_dims_random_tensorrt.cc | 29 +++++++++++++ ...egative_axes_keep_dims_example_tensorrt.cc | 29 +++++++++++++ ...negative_axes_keep_dims_random_tensorrt.cc | 29 +++++++++++++ ...negative_axes_keepdims_example_tensorrt.cc | 29 +++++++++++++ ..._negative_axes_keepdims_random_tensorrt.cc | 29 +++++++++++++ ...t_reduce_log_sum_negative_axes_tensorrt.cc | 29 +++++++++++++ ...negative_axes_keepdims_example_tensorrt.cc | 29 +++++++++++++ ..._negative_axes_keepdims_random_tensorrt.cc | 29 +++++++++++++ ...negative_axes_keepdims_example_tensorrt.cc | 29 +++++++++++++ ..._negative_axes_keepdims_random_tensorrt.cc | 29 +++++++++++++ ...negative_axes_keepdims_example_tensorrt.cc | 29 +++++++++++++ ..._negative_axes_keepdims_random_tensorrt.cc | 29 +++++++++++++ ...negative_axes_keepdims_example_tensorrt.cc | 29 +++++++++++++ ..._negative_axes_keepdims_random_tensorrt.cc | 29 +++++++++++++ ..._empty_axes_input_noop_example_tensorrt.cc | 30 +++++++++++++ ...m_empty_axes_input_noop_random_tensorrt.cc | 30 +++++++++++++ ...negative_axes_keepdims_example_tensorrt.cc | 30 +++++++++++++ ..._negative_axes_keepdims_random_tensorrt.cc | 30 +++++++++++++ ...negative_axes_keepdims_example_tensorrt.cc | 29 +++++++++++++ ..._negative_axes_keepdims_random_tensorrt.cc | 29 +++++++++++++ ...reshape_negative_extended_dims_tensorrt.cc | 30 +++++++++++++ ...est_reshape_reordered_all_dims_tensorrt.cc | 30 +++++++++++++ ...st_reshape_reordered_last_dims_tensorrt.cc | 30 +++++++++++++ ..._reshape_zero_and_negative_dim_tensorrt.cc | 30 +++++++++++++ .../test_reshape_zero_dim_tensorrt.cc | 30 +++++++++++++ ...s_cubic_A_n0p5_exclude_outside_tensorrt.cc | 30 +++++++++++++ ...ple_scales_cubic_align_corners_tensorrt.cc | 30 +++++++++++++ ...resize_downsample_scales_cubic_tensorrt.cc | 30 +++++++++++++ ...le_scales_linear_align_corners_tensorrt.cc | 30 +++++++++++++ ...esize_downsample_scales_linear_tensorrt.cc | 30 +++++++++++++ ...size_downsample_scales_nearest_tensorrt.cc | 30 +++++++++++++ ..._resize_downsample_sizes_cubic_tensorrt.cc | 30 +++++++++++++ ...izes_linear_pytorch_half_pixel_tensorrt.cc | 30 +++++++++++++ ...esize_downsample_sizes_nearest_tensorrt.cc | 30 +++++++++++++ ...s_nearest_tf_half_pixel_for_nn_tensorrt.cc | 32 ++++++++++++++ ...test_resize_tf_crop_and_resize_tensorrt.cc | 31 +++++++++++++ ...s_cubic_A_n0p5_exclude_outside_tensorrt.cc | 30 +++++++++++++ ...ple_scales_cubic_align_corners_tensorrt.cc | 30 +++++++++++++ ...sample_scales_cubic_asymmetric_tensorrt.cc | 30 +++++++++++++ ...t_resize_upsample_scales_cubic_tensorrt.cc | 30 +++++++++++++ ...le_scales_linear_align_corners_tensorrt.cc | 30 +++++++++++++ ..._resize_upsample_scales_linear_tensorrt.cc | 30 +++++++++++++ ...resize_upsample_scales_nearest_tensorrt.cc | 30 +++++++++++++ ...st_resize_upsample_sizes_cubic_tensorrt.cc | 30 +++++++++++++ ..._sizes_nearest_ceil_half_pixel_tensorrt.cc | 30 +++++++++++++ ...es_nearest_floor_align_corners_tensorrt.cc | 30 +++++++++++++ ...t_round_prefer_ceil_asymmetric_tensorrt.cc | 30 +++++++++++++ ..._resize_upsample_sizes_nearest_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_round_tensorrt.cc | 29 +++++++++++++ ...est_scatter_elements_with_axis_tensorrt.cc | 31 +++++++++++++ ...elements_with_negative_indices_tensorrt.cc | 31 +++++++++++++ ..._scatter_elements_without_axis_tensorrt.cc | 31 +++++++++++++ .../test_tensorrt/test_scatternd_tensorrt.cc | 31 +++++++++++++ ...an_weight_negative_ii_expanded_tensorrt.cc | 31 +++++++++++++ ..._negative_ii_log_prob_expanded_tensorrt.cc | 32 ++++++++++++++ ...an_weight_negative_ii_log_prob_tensorrt.cc | 32 ++++++++++++++ ...e_NCd1_mean_weight_negative_ii_tensorrt.cc | 31 +++++++++++++ ...no_weight_negative_ii_expanded_tensorrt.cc | 30 +++++++++++++ ..._negative_ii_log_prob_expanded_tensorrt.cc | 31 +++++++++++++ ...no_weight_negative_ii_log_prob_tensorrt.cc | 31 +++++++++++++ ...2d3_none_no_weight_negative_ii_tensorrt.cc | 30 +++++++++++++ ...d3_sum_weight_high_ii_expanded_tensorrt.cc | 31 +++++++++++++ ...ight_high_ii_log_prob_expanded_tensorrt.cc | 32 ++++++++++++++ ...d3_sum_weight_high_ii_log_prob_tensorrt.cc | 32 ++++++++++++++ ...ce_NCd1d2d3_sum_weight_high_ii_tensorrt.cc | 31 +++++++++++++ ...1d2d3d4d5_mean_weight_expanded_tensorrt.cc | 31 +++++++++++++ ..._mean_weight_log_prob_expanded_tensorrt.cc | 32 ++++++++++++++ ...1d2d3d4d5_mean_weight_log_prob_tensorrt.cc | 32 ++++++++++++++ ...t_sce_NCd1d2d3d4d5_mean_weight_tensorrt.cc | 31 +++++++++++++ ...d3d4d5_none_no_weight_expanded_tensorrt.cc | 30 +++++++++++++ ...ne_no_weight_log_prob_expanded_tensorrt.cc | 31 +++++++++++++ ...d3d4d5_none_no_weight_log_prob_tensorrt.cc | 31 +++++++++++++ ...ce_NCd1d2d3d4d5_none_no_weight_tensorrt.cc | 30 +++++++++++++ .../test_sce_mean_3d_expanded_tensorrt.cc | 30 +++++++++++++ ..._sce_mean_3d_log_prob_expanded_tensorrt.cc | 31 +++++++++++++ .../test_sce_mean_3d_log_prob_tensorrt.cc | 31 +++++++++++++ .../test_sce_mean_3d_tensorrt.cc | 30 +++++++++++++ .../test_sce_mean_expanded_tensorrt.cc | 30 +++++++++++++ ...est_sce_mean_log_prob_expanded_tensorrt.cc | 31 +++++++++++++ .../test_sce_mean_log_prob_tensorrt.cc | 31 +++++++++++++ ..._mean_no_weight_ii_3d_expanded_tensorrt.cc | 30 +++++++++++++ ...weight_ii_3d_log_prob_expanded_tensorrt.cc | 31 +++++++++++++ ..._mean_no_weight_ii_3d_log_prob_tensorrt.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_3d_tensorrt.cc | 30 +++++++++++++ ..._mean_no_weight_ii_4d_expanded_tensorrt.cc | 30 +++++++++++++ ...weight_ii_4d_log_prob_expanded_tensorrt.cc | 31 +++++++++++++ ..._mean_no_weight_ii_4d_log_prob_tensorrt.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_4d_tensorrt.cc | 30 +++++++++++++ ...sce_mean_no_weight_ii_expanded_tensorrt.cc | 30 +++++++++++++ ...no_weight_ii_log_prob_expanded_tensorrt.cc | 31 +++++++++++++ ...sce_mean_no_weight_ii_log_prob_tensorrt.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_tensorrt.cc | 30 +++++++++++++ .../test_tensorrt/test_sce_mean_tensorrt.cc | 30 +++++++++++++ .../test_sce_mean_weight_expanded_tensorrt.cc | 31 +++++++++++++ ...sce_mean_weight_ii_3d_expanded_tensorrt.cc | 31 +++++++++++++ ...weight_ii_3d_log_prob_expanded_tensorrt.cc | 32 ++++++++++++++ ...sce_mean_weight_ii_3d_log_prob_tensorrt.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_3d_tensorrt.cc | 31 +++++++++++++ ...sce_mean_weight_ii_4d_expanded_tensorrt.cc | 31 +++++++++++++ ...weight_ii_4d_log_prob_expanded_tensorrt.cc | 32 ++++++++++++++ ...sce_mean_weight_ii_4d_log_prob_tensorrt.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_4d_tensorrt.cc | 31 +++++++++++++ ...st_sce_mean_weight_ii_expanded_tensorrt.cc | 31 +++++++++++++ ...an_weight_ii_log_prob_expanded_tensorrt.cc | 32 ++++++++++++++ ...st_sce_mean_weight_ii_log_prob_tensorrt.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_tensorrt.cc | 31 +++++++++++++ ..._mean_weight_log_prob_expanded_tensorrt.cc | 32 ++++++++++++++ .../test_sce_mean_weight_log_prob_tensorrt.cc | 32 ++++++++++++++ .../test_sce_mean_weight_tensorrt.cc | 31 +++++++++++++ .../test_sce_none_expanded_tensorrt.cc | 30 +++++++++++++ ...est_sce_none_log_prob_expanded_tensorrt.cc | 31 +++++++++++++ .../test_sce_none_log_prob_tensorrt.cc | 31 +++++++++++++ .../test_tensorrt/test_sce_none_tensorrt.cc | 30 +++++++++++++ ...test_sce_none_weights_expanded_tensorrt.cc | 31 +++++++++++++ ...none_weights_log_prob_expanded_tensorrt.cc | 32 ++++++++++++++ ...test_sce_none_weights_log_prob_tensorrt.cc | 32 ++++++++++++++ .../test_sce_none_weights_tensorrt.cc | 31 +++++++++++++ .../test_sce_sum_expanded_tensorrt.cc | 30 +++++++++++++ ...test_sce_sum_log_prob_expanded_tensorrt.cc | 31 +++++++++++++ .../test_sce_sum_log_prob_tensorrt.cc | 31 +++++++++++++ .../test_tensorrt/test_sce_sum_tensorrt.cc | 30 +++++++++++++ .../test_sequence_insert_at_back_tensorrt.cc | 30 +++++++++++++ .../test_sequence_insert_at_front_tensorrt.cc | 31 +++++++++++++ .../test_slice_negative_axes_tensorrt.cc | 32 ++++++++++++++ .../test_softmax_axis_0_expanded_tensorrt.cc | 29 +++++++++++++ .../test_softmax_axis_1_expanded_tensorrt.cc | 29 +++++++++++++ .../test_softmax_axis_2_expanded_tensorrt.cc | 29 +++++++++++++ ..._softmax_default_axis_expanded_tensorrt.cc | 29 +++++++++++++ .../test_softmax_example_expanded_tensorrt.cc | 29 +++++++++++++ ..._softmax_large_number_expanded_tensorrt.cc | 29 +++++++++++++ ...softmax_negative_axis_expanded_tensorrt.cc | 29 +++++++++++++ .../test_softmax_negative_axis_tensorrt.cc | 29 +++++++++++++ .../test_split_zero_size_splits_tensorrt.cc | 32 ++++++++++++++ .../test_squeeze_negative_axes_tensorrt.cc | 30 +++++++++++++ .../test_top_k_negative_axis_tensorrt.cc | 31 +++++++++++++ .../test_top_k_smallest_tensorrt.cc | 31 +++++++++++++ ..._training_dropout_default_mask_tensorrt.cc | 32 ++++++++++++++ .../test_training_dropout_default_tensorrt.cc | 31 +++++++++++++ .../test_training_dropout_mask_tensorrt.cc | 32 ++++++++++++++ .../test_training_dropout_tensorrt.cc | 31 +++++++++++++ ...aining_dropout_zero_ratio_mask_tensorrt.cc | 32 ++++++++++++++ ...st_training_dropout_zero_ratio_tensorrt.cc | 31 +++++++++++++ ...unique_not_sorted_without_axis_tensorrt.cc | 32 ++++++++++++++ ...est_unique_sorted_with_axis_3d_tensorrt.cc | 32 ++++++++++++++ .../test_unique_sorted_with_axis_tensorrt.cc | 32 ++++++++++++++ ...ique_sorted_with_negative_axis_tensorrt.cc | 32 ++++++++++++++ ...est_unique_sorted_without_axis_tensorrt.cc | 32 ++++++++++++++ .../test_unsqueeze_axis_0_tensorrt.cc | 30 +++++++++++++ .../test_unsqueeze_axis_1_tensorrt.cc | 30 +++++++++++++ .../test_unsqueeze_axis_2_tensorrt.cc | 30 +++++++++++++ .../test_unsqueeze_axis_3_tensorrt.cc | 29 +++++++++++++ .../test_unsqueeze_negative_axes_tensorrt.cc | 30 +++++++++++++ .../test_unsqueeze_three_axes_tensorrt.cc | 30 +++++++++++++ .../test_unsqueeze_two_axes_tensorrt.cc | 30 +++++++++++++ .../test_unsqueeze_unsorted_axes_tensorrt.cc | 30 +++++++++++++ .../test_where_long_example_tensorrt.cc | 31 +++++++++++++ .../test_adagrad_multiple_xnnpack.cc | 39 +++++++++++++++++ .../test_xnnpack/test_adagrad_xnnpack.cc | 34 +++++++++++++++ .../test_adam_multiple_xnnpack.cc | 43 +++++++++++++++++++ .../test_xnnpack/test_adam_xnnpack.cc | 36 ++++++++++++++++ ..._axis_example_select_last_index_xnnpack.cc | 29 +++++++++++++ ...t_axis_random_select_last_index_xnnpack.cc | 29 +++++++++++++ ...pdims_example_select_last_index_xnnpack.cc | 29 +++++++++++++ ...epdims_random_select_last_index_xnnpack.cc | 29 +++++++++++++ ...pdims_example_select_last_index_xnnpack.cc | 29 +++++++++++++ ..._negative_axis_keepdims_example_xnnpack.cc | 29 +++++++++++++ ...epdims_random_select_last_index_xnnpack.cc | 29 +++++++++++++ ...x_negative_axis_keepdims_random_xnnpack.cc | 29 +++++++++++++ ...pdims_example_select_last_index_xnnpack.cc | 29 +++++++++++++ ...epdims_random_select_last_index_xnnpack.cc | 29 +++++++++++++ ..._axis_example_select_last_index_xnnpack.cc | 29 +++++++++++++ ...t_axis_random_select_last_index_xnnpack.cc | 29 +++++++++++++ ...pdims_example_select_last_index_xnnpack.cc | 29 +++++++++++++ ...epdims_random_select_last_index_xnnpack.cc | 29 +++++++++++++ ...pdims_example_select_last_index_xnnpack.cc | 29 +++++++++++++ ..._negative_axis_keepdims_example_xnnpack.cc | 29 +++++++++++++ ...epdims_random_select_last_index_xnnpack.cc | 29 +++++++++++++ ...n_negative_axis_keepdims_random_xnnpack.cc | 29 +++++++++++++ ...pdims_example_select_last_index_xnnpack.cc | 29 +++++++++++++ ...epdims_random_select_last_index_xnnpack.cc | 29 +++++++++++++ .../test_bitshift_left_uint16_xnnpack.cc | 30 +++++++++++++ .../test_bitshift_left_uint32_xnnpack.cc | 30 +++++++++++++ .../test_bitshift_left_uint64_xnnpack.cc | 30 +++++++++++++ .../test_bitshift_left_uint8_xnnpack.cc | 30 +++++++++++++ .../test_bitshift_right_uint16_xnnpack.cc | 30 +++++++++++++ .../test_bitshift_right_uint32_xnnpack.cc | 30 +++++++++++++ .../test_bitshift_right_uint64_xnnpack.cc | 30 +++++++++++++ .../test_bitshift_right_uint8_xnnpack.cc | 30 +++++++++++++ .../test_cast_BFLOAT16_to_FLOAT_xnnpack.cc | 29 +++++++++++++ .../test_cast_FLOAT_to_BFLOAT16_xnnpack.cc | 29 +++++++++++++ .../test_celu_expanded_xnnpack.cc | 29 +++++++++++++ .../test_xnnpack/test_celu_xnnpack.cc | 29 +++++++++++++ ...test_clip_default_int8_inbounds_xnnpack.cc | 29 +++++++++++++ .../test_clip_default_int8_max_xnnpack.cc | 30 +++++++++++++ .../test_clip_default_int8_min_xnnpack.cc | 30 +++++++++++++ .../test_compress_negative_axis_xnnpack.cc | 30 +++++++++++++ .../test_concat_1d_axis_negative_1_xnnpack.cc | 30 +++++++++++++ .../test_concat_2d_axis_negative_1_xnnpack.cc | 30 +++++++++++++ .../test_concat_2d_axis_negative_2_xnnpack.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_1_xnnpack.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_2_xnnpack.cc | 30 +++++++++++++ .../test_concat_3d_axis_negative_3_xnnpack.cc | 30 +++++++++++++ ..._constantofshape_int_shape_zero_xnnpack.cc | 29 +++++++++++++ .../test_cumsum_1d_exclusive_xnnpack.cc | 30 +++++++++++++ ...est_cumsum_1d_reverse_exclusive_xnnpack.cc | 30 +++++++++++++ .../test_cumsum_1d_reverse_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_cumsum_1d_xnnpack.cc | 30 +++++++++++++ .../test_cumsum_2d_axis_0_xnnpack.cc | 30 +++++++++++++ .../test_cumsum_2d_axis_1_xnnpack.cc | 30 +++++++++++++ .../test_cumsum_2d_negative_axis_xnnpack.cc | 30 +++++++++++++ ...t_depthtospace_crd_mode_example_xnnpack.cc | 29 +++++++++++++ .../test_depthtospace_crd_mode_xnnpack.cc | 29 +++++++++++++ .../test_depthtospace_dcr_mode_xnnpack.cc | 29 +++++++++++++ .../test_dequantizelinear_axis_xnnpack.cc | 31 +++++++++++++ .../test_xnnpack/test_det_2d_xnnpack.cc | 29 +++++++++++++ .../test_xnnpack/test_det_nd_xnnpack.cc | 29 +++++++++++++ ...test_dropout_default_mask_ratio_xnnpack.cc | 31 +++++++++++++ .../test_dropout_default_mask_xnnpack.cc | 30 +++++++++++++ .../test_dropout_default_old_xnnpack.cc | 29 +++++++++++++ .../test_dropout_default_ratio_xnnpack.cc | 30 +++++++++++++ .../test_dropout_random_old_xnnpack.cc | 29 +++++++++++++ ..._dynamicquantizelinear_expanded_xnnpack.cc | 31 +++++++++++++ ...izelinear_max_adjusted_expanded_xnnpack.cc | 31 +++++++++++++ ...amicquantizelinear_max_adjusted_xnnpack.cc | 31 +++++++++++++ ...izelinear_min_adjusted_expanded_xnnpack.cc | 31 +++++++++++++ ...amicquantizelinear_min_adjusted_xnnpack.cc | 31 +++++++++++++ .../test_dynamicquantizelinear_xnnpack.cc | 31 +++++++++++++ .../test_einsum_batch_diagonal_xnnpack.cc | 29 +++++++++++++ .../test_einsum_batch_matmul_xnnpack.cc | 30 +++++++++++++ .../test_einsum_inner_prod_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_einsum_sum_xnnpack.cc | 29 +++++++++++++ .../test_einsum_transpose_xnnpack.cc | 29 +++++++++++++ .../test_flatten_negative_axis1_xnnpack.cc | 29 +++++++++++++ .../test_flatten_negative_axis2_xnnpack.cc | 29 +++++++++++++ .../test_flatten_negative_axis3_xnnpack.cc | 29 +++++++++++++ .../test_flatten_negative_axis4_xnnpack.cc | 29 +++++++++++++ .../test_gather_2d_indices_xnnpack.cc | 30 +++++++++++++ .../test_gather_elements_0_xnnpack.cc | 30 +++++++++++++ .../test_gather_elements_1_xnnpack.cc | 30 +++++++++++++ ...ather_elements_negative_indices_xnnpack.cc | 30 +++++++++++++ .../test_gather_negative_indices_xnnpack.cc | 30 +++++++++++++ .../test_gathernd_example_float32_xnnpack.cc | 30 +++++++++++++ ...thernd_example_int32_batch_dim1_xnnpack.cc | 30 +++++++++++++ .../test_gathernd_example_int32_xnnpack.cc | 30 +++++++++++++ .../test_gemm_all_attributes_xnnpack.cc | 31 +++++++++++++ .../test_xnnpack/test_gemm_alpha_xnnpack.cc | 31 +++++++++++++ .../test_xnnpack/test_gemm_beta_xnnpack.cc | 31 +++++++++++++ .../test_gemm_default_matrix_bias_xnnpack.cc | 31 +++++++++++++ .../test_gemm_default_no_bias_xnnpack.cc | 30 +++++++++++++ .../test_gemm_default_scalar_bias_xnnpack.cc | 31 +++++++++++++ ...default_single_elem_vector_bias_xnnpack.cc | 31 +++++++++++++ .../test_gemm_default_vector_bias_xnnpack.cc | 31 +++++++++++++ .../test_gemm_default_zero_bias_xnnpack.cc | 31 +++++++++++++ .../test_gemm_transposeA_xnnpack.cc | 31 +++++++++++++ .../test_gemm_transposeB_xnnpack.cc | 31 +++++++++++++ ...st_greater_equal_bcast_expanded_xnnpack.cc | 30 +++++++++++++ .../test_greater_equal_bcast_xnnpack.cc | 30 +++++++++++++ .../test_greater_equal_expanded_xnnpack.cc | 30 +++++++++++++ .../test_greater_equal_xnnpack.cc | 30 +++++++++++++ .../test_hardmax_negative_axis_xnnpack.cc | 29 +++++++++++++ .../test_xnnpack/test_if_seq_xnnpack.cc | 29 +++++++++++++ .../lit_cases/test_xnnpack/test_if_xnnpack.cc | 29 +++++++++++++ .../test_less_equal_bcast_expanded_xnnpack.cc | 30 +++++++++++++ .../test_less_equal_bcast_xnnpack.cc | 30 +++++++++++++ .../test_less_equal_expanded_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_less_equal_xnnpack.cc | 30 +++++++++++++ ...test_logsoftmax_axis_0_expanded_xnnpack.cc | 29 +++++++++++++ ...test_logsoftmax_axis_1_expanded_xnnpack.cc | 29 +++++++++++++ ...test_logsoftmax_axis_2_expanded_xnnpack.cc | 29 +++++++++++++ ...ogsoftmax_default_axis_expanded_xnnpack.cc | 29 +++++++++++++ ...t_logsoftmax_example_1_expanded_xnnpack.cc | 29 +++++++++++++ ...ogsoftmax_large_number_expanded_xnnpack.cc | 29 +++++++++++++ ...gsoftmax_negative_axis_expanded_xnnpack.cc | 29 +++++++++++++ .../test_logsoftmax_negative_axis_xnnpack.cc | 29 +++++++++++++ .../test_xnnpack/test_loop11_xnnpack.cc | 32 ++++++++++++++ .../test_xnnpack/test_loop13_seq_xnnpack.cc | 31 +++++++++++++ .../test_xnnpack/test_max_float16_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_max_float32_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_max_float64_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_max_int16_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_max_int32_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_max_int64_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_max_int8_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_max_uint16_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_max_uint32_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_max_uint64_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_max_uint8_xnnpack.cc | 30 +++++++++++++ .../test_maxpool_2d_uint8_xnnpack.cc | 29 +++++++++++++ .../test_xnnpack/test_min_float16_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_min_float32_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_min_float64_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_min_int16_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_min_int32_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_min_int64_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_min_int8_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_min_uint16_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_min_uint32_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_min_uint64_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_min_uint8_xnnpack.cc | 30 +++++++++++++ .../test_mod_broadcast_xnnpack.cc | 30 +++++++++++++ .../test_mod_int64_fmod_xnnpack.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float16_xnnpack.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float32_xnnpack.cc | 30 +++++++++++++ .../test_mod_mixed_sign_float64_xnnpack.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int16_xnnpack.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int32_xnnpack.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int64_xnnpack.cc | 30 +++++++++++++ .../test_mod_mixed_sign_int8_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_mod_uint16_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_mod_uint32_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_mod_uint64_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_mod_uint8_xnnpack.cc | 30 +++++++++++++ .../test_momentum_multiple_xnnpack.cc | 39 +++++++++++++++++ .../test_xnnpack/test_momentum_xnnpack.cc | 34 +++++++++++++++ .../test_nesterov_momentum_xnnpack.cc | 34 +++++++++++++++ .../test_nllloss_NC_expanded_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_nllloss_NC_xnnpack.cc | 30 +++++++++++++ .../test_nllloss_NCd1_expanded_xnnpack.cc | 30 +++++++++++++ .../test_nllloss_NCd1_ii_expanded_xnnpack.cc | 30 +++++++++++++ .../test_nllloss_NCd1_ii_xnnpack.cc | 30 +++++++++++++ ...ean_weight_negative_ii_expanded_xnnpack.cc | 31 +++++++++++++ ...ss_NCd1_mean_weight_negative_ii_xnnpack.cc | 31 +++++++++++++ ...st_nllloss_NCd1_weight_expanded_xnnpack.cc | 31 +++++++++++++ ...nllloss_NCd1_weight_ii_expanded_xnnpack.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_ii_xnnpack.cc | 31 +++++++++++++ .../test_nllloss_NCd1_weight_xnnpack.cc | 31 +++++++++++++ .../test_xnnpack/test_nllloss_NCd1_xnnpack.cc | 30 +++++++++++++ .../test_nllloss_NCd1d2_expanded_xnnpack.cc | 30 +++++++++++++ ...ight_reduction_mean_ii_expanded_xnnpack.cc | 30 +++++++++++++ ...1d2_no_weight_reduction_mean_ii_xnnpack.cc | 30 +++++++++++++ ..._NCd1d2_reduction_mean_expanded_xnnpack.cc | 30 +++++++++++++ ...t_nllloss_NCd1d2_reduction_mean_xnnpack.cc | 30 +++++++++++++ ...s_NCd1d2_reduction_sum_expanded_xnnpack.cc | 30 +++++++++++++ ...st_nllloss_NCd1d2_reduction_sum_xnnpack.cc | 30 +++++++++++++ ...oss_NCd1d2_with_weight_expanded_xnnpack.cc | 31 +++++++++++++ ..._weight_reduction_mean_expanded_xnnpack.cc | 31 +++++++++++++ ...d1d2_with_weight_reduction_mean_xnnpack.cc | 31 +++++++++++++ ...h_weight_reduction_sum_expanded_xnnpack.cc | 31 +++++++++++++ ...eight_reduction_sum_ii_expanded_xnnpack.cc | 31 +++++++++++++ ...d2_with_weight_reduction_sum_ii_xnnpack.cc | 31 +++++++++++++ ...Cd1d2_with_weight_reduction_sum_xnnpack.cc | 31 +++++++++++++ ...test_nllloss_NCd1d2_with_weight_xnnpack.cc | 31 +++++++++++++ .../test_nllloss_NCd1d2_xnnpack.cc | 30 +++++++++++++ ..._no_weight_negative_ii_expanded_xnnpack.cc | 30 +++++++++++++ ...d2d3_none_no_weight_negative_ii_xnnpack.cc | 30 +++++++++++++ ...2d3_sum_weight_high_ii_expanded_xnnpack.cc | 31 +++++++++++++ ...oss_NCd1d2d3_sum_weight_high_ii_xnnpack.cc | 31 +++++++++++++ ...d1d2d3d4d5_mean_weight_expanded_xnnpack.cc | 31 +++++++++++++ ...llloss_NCd1d2d3d4d5_mean_weight_xnnpack.cc | 31 +++++++++++++ ...2d3d4d5_none_no_weight_expanded_xnnpack.cc | 30 +++++++++++++ ...oss_NCd1d2d3d4d5_none_no_weight_xnnpack.cc | 30 +++++++++++++ .../test_onehot_negative_indices_xnnpack.cc | 31 +++++++++++++ .../test_onehot_with_negative_axis_xnnpack.cc | 31 +++++++++++++ .../test_pow_types_float32_int32_xnnpack.cc | 30 +++++++++++++ .../test_pow_types_float32_int64_xnnpack.cc | 30 +++++++++++++ .../test_pow_types_float32_uint32_xnnpack.cc | 30 +++++++++++++ .../test_pow_types_float32_uint64_xnnpack.cc | 30 +++++++++++++ .../test_pow_types_float_xnnpack.cc | 30 +++++++++++++ .../test_pow_types_int32_float32_xnnpack.cc | 30 +++++++++++++ .../test_pow_types_int32_int32_xnnpack.cc | 30 +++++++++++++ .../test_pow_types_int64_float32_xnnpack.cc | 30 +++++++++++++ .../test_pow_types_int64_int64_xnnpack.cc | 30 +++++++++++++ .../test_pow_types_int_xnnpack.cc | 30 +++++++++++++ .../test_quantizelinear_axis_xnnpack.cc | 31 +++++++++++++ ...at_type_positive_delta_expanded_xnnpack.cc | 31 +++++++++++++ ...range_float_type_positive_delta_xnnpack.cc | 31 +++++++++++++ ...32_type_negative_delta_expanded_xnnpack.cc | 31 +++++++++++++ ...range_int32_type_negative_delta_xnnpack.cc | 31 +++++++++++++ ...negative_axes_keep_dims_example_xnnpack.cc | 29 +++++++++++++ ..._negative_axes_keep_dims_random_xnnpack.cc | 29 +++++++++++++ ...negative_axes_keep_dims_example_xnnpack.cc | 29 +++++++++++++ ..._negative_axes_keep_dims_random_xnnpack.cc | 29 +++++++++++++ ..._negative_axes_keepdims_example_xnnpack.cc | 29 +++++++++++++ ...p_negative_axes_keepdims_random_xnnpack.cc | 29 +++++++++++++ ...st_reduce_log_sum_negative_axes_xnnpack.cc | 29 +++++++++++++ ..._negative_axes_keepdims_example_xnnpack.cc | 29 +++++++++++++ ...x_negative_axes_keepdims_random_xnnpack.cc | 29 +++++++++++++ ..._negative_axes_keepdims_example_xnnpack.cc | 29 +++++++++++++ ...n_negative_axes_keepdims_random_xnnpack.cc | 29 +++++++++++++ ..._negative_axes_keepdims_example_xnnpack.cc | 29 +++++++++++++ ...n_negative_axes_keepdims_random_xnnpack.cc | 29 +++++++++++++ ..._negative_axes_keepdims_example_xnnpack.cc | 29 +++++++++++++ ...d_negative_axes_keepdims_random_xnnpack.cc | 29 +++++++++++++ ...m_empty_axes_input_noop_example_xnnpack.cc | 30 +++++++++++++ ...um_empty_axes_input_noop_random_xnnpack.cc | 30 +++++++++++++ ..._negative_axes_keepdims_example_xnnpack.cc | 30 +++++++++++++ ...m_negative_axes_keepdims_random_xnnpack.cc | 30 +++++++++++++ ..._negative_axes_keepdims_example_xnnpack.cc | 29 +++++++++++++ ...e_negative_axes_keepdims_random_xnnpack.cc | 29 +++++++++++++ ..._reshape_negative_extended_dims_xnnpack.cc | 30 +++++++++++++ ...test_reshape_reordered_all_dims_xnnpack.cc | 30 +++++++++++++ ...est_reshape_reordered_last_dims_xnnpack.cc | 30 +++++++++++++ ...t_reshape_zero_and_negative_dim_xnnpack.cc | 30 +++++++++++++ .../test_reshape_zero_dim_xnnpack.cc | 30 +++++++++++++ ...es_cubic_A_n0p5_exclude_outside_xnnpack.cc | 30 +++++++++++++ ...mple_scales_cubic_align_corners_xnnpack.cc | 30 +++++++++++++ ..._resize_downsample_scales_cubic_xnnpack.cc | 30 +++++++++++++ ...ple_scales_linear_align_corners_xnnpack.cc | 30 +++++++++++++ ...resize_downsample_scales_linear_xnnpack.cc | 30 +++++++++++++ ...esize_downsample_scales_nearest_xnnpack.cc | 30 +++++++++++++ ...t_resize_downsample_sizes_cubic_xnnpack.cc | 30 +++++++++++++ ...sizes_linear_pytorch_half_pixel_xnnpack.cc | 30 +++++++++++++ ...es_nearest_tf_half_pixel_for_nn_xnnpack.cc | 32 ++++++++++++++ ...resize_downsample_sizes_nearest_xnnpack.cc | 30 +++++++++++++ .../test_resize_tf_crop_and_resize_xnnpack.cc | 31 +++++++++++++ ...es_cubic_A_n0p5_exclude_outside_xnnpack.cc | 30 +++++++++++++ ...mple_scales_cubic_align_corners_xnnpack.cc | 30 +++++++++++++ ...psample_scales_cubic_asymmetric_xnnpack.cc | 30 +++++++++++++ ...st_resize_upsample_scales_cubic_xnnpack.cc | 30 +++++++++++++ ...ple_scales_linear_align_corners_xnnpack.cc | 30 +++++++++++++ ...t_resize_upsample_scales_linear_xnnpack.cc | 30 +++++++++++++ ..._resize_upsample_scales_nearest_xnnpack.cc | 30 +++++++++++++ ...est_resize_upsample_sizes_cubic_xnnpack.cc | 30 +++++++++++++ ...e_sizes_nearest_ceil_half_pixel_xnnpack.cc | 30 +++++++++++++ ...zes_nearest_floor_align_corners_xnnpack.cc | 30 +++++++++++++ ...st_round_prefer_ceil_asymmetric_xnnpack.cc | 30 +++++++++++++ ...t_resize_upsample_sizes_nearest_xnnpack.cc | 30 +++++++++++++ .../test_xnnpack/test_round_xnnpack.cc | 29 +++++++++++++ ...test_scatter_elements_with_axis_xnnpack.cc | 31 +++++++++++++ ..._elements_with_negative_indices_xnnpack.cc | 31 +++++++++++++ ...t_scatter_elements_without_axis_xnnpack.cc | 31 +++++++++++++ .../test_xnnpack/test_scatternd_xnnpack.cc | 31 +++++++++++++ ...ean_weight_negative_ii_expanded_xnnpack.cc | 31 +++++++++++++ ...t_negative_ii_log_prob_expanded_xnnpack.cc | 32 ++++++++++++++ ...ean_weight_negative_ii_log_prob_xnnpack.cc | 32 ++++++++++++++ ...ce_NCd1_mean_weight_negative_ii_xnnpack.cc | 31 +++++++++++++ ..._no_weight_negative_ii_expanded_xnnpack.cc | 30 +++++++++++++ ...t_negative_ii_log_prob_expanded_xnnpack.cc | 31 +++++++++++++ ..._no_weight_negative_ii_log_prob_xnnpack.cc | 31 +++++++++++++ ...d2d3_none_no_weight_negative_ii_xnnpack.cc | 30 +++++++++++++ ...2d3_sum_weight_high_ii_expanded_xnnpack.cc | 31 +++++++++++++ ...eight_high_ii_log_prob_expanded_xnnpack.cc | 32 ++++++++++++++ ...2d3_sum_weight_high_ii_log_prob_xnnpack.cc | 32 ++++++++++++++ ...sce_NCd1d2d3_sum_weight_high_ii_xnnpack.cc | 31 +++++++++++++ ...d1d2d3d4d5_mean_weight_expanded_xnnpack.cc | 31 +++++++++++++ ...5_mean_weight_log_prob_expanded_xnnpack.cc | 32 ++++++++++++++ ...d1d2d3d4d5_mean_weight_log_prob_xnnpack.cc | 32 ++++++++++++++ ...st_sce_NCd1d2d3d4d5_mean_weight_xnnpack.cc | 31 +++++++++++++ ...2d3d4d5_none_no_weight_expanded_xnnpack.cc | 30 +++++++++++++ ...one_no_weight_log_prob_expanded_xnnpack.cc | 31 +++++++++++++ ...2d3d4d5_none_no_weight_log_prob_xnnpack.cc | 31 +++++++++++++ ...sce_NCd1d2d3d4d5_none_no_weight_xnnpack.cc | 30 +++++++++++++ .../test_sce_mean_3d_expanded_xnnpack.cc | 30 +++++++++++++ ...t_sce_mean_3d_log_prob_expanded_xnnpack.cc | 31 +++++++++++++ .../test_sce_mean_3d_log_prob_xnnpack.cc | 31 +++++++++++++ .../test_xnnpack/test_sce_mean_3d_xnnpack.cc | 30 +++++++++++++ .../test_sce_mean_expanded_xnnpack.cc | 30 +++++++++++++ ...test_sce_mean_log_prob_expanded_xnnpack.cc | 31 +++++++++++++ .../test_sce_mean_log_prob_xnnpack.cc | 31 +++++++++++++ ...e_mean_no_weight_ii_3d_expanded_xnnpack.cc | 30 +++++++++++++ ..._weight_ii_3d_log_prob_expanded_xnnpack.cc | 31 +++++++++++++ ...e_mean_no_weight_ii_3d_log_prob_xnnpack.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_3d_xnnpack.cc | 30 +++++++++++++ ...e_mean_no_weight_ii_4d_expanded_xnnpack.cc | 30 +++++++++++++ ..._weight_ii_4d_log_prob_expanded_xnnpack.cc | 31 +++++++++++++ ...e_mean_no_weight_ii_4d_log_prob_xnnpack.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_4d_xnnpack.cc | 30 +++++++++++++ ..._sce_mean_no_weight_ii_expanded_xnnpack.cc | 30 +++++++++++++ ..._no_weight_ii_log_prob_expanded_xnnpack.cc | 31 +++++++++++++ ..._sce_mean_no_weight_ii_log_prob_xnnpack.cc | 31 +++++++++++++ .../test_sce_mean_no_weight_ii_xnnpack.cc | 30 +++++++++++++ .../test_sce_mean_weight_expanded_xnnpack.cc | 31 +++++++++++++ ..._sce_mean_weight_ii_3d_expanded_xnnpack.cc | 31 +++++++++++++ ..._weight_ii_3d_log_prob_expanded_xnnpack.cc | 32 ++++++++++++++ ..._sce_mean_weight_ii_3d_log_prob_xnnpack.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_3d_xnnpack.cc | 31 +++++++++++++ ..._sce_mean_weight_ii_4d_expanded_xnnpack.cc | 31 +++++++++++++ ..._weight_ii_4d_log_prob_expanded_xnnpack.cc | 32 ++++++++++++++ ..._sce_mean_weight_ii_4d_log_prob_xnnpack.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_4d_xnnpack.cc | 31 +++++++++++++ ...est_sce_mean_weight_ii_expanded_xnnpack.cc | 31 +++++++++++++ ...ean_weight_ii_log_prob_expanded_xnnpack.cc | 32 ++++++++++++++ ...est_sce_mean_weight_ii_log_prob_xnnpack.cc | 32 ++++++++++++++ .../test_sce_mean_weight_ii_xnnpack.cc | 31 +++++++++++++ ...e_mean_weight_log_prob_expanded_xnnpack.cc | 32 ++++++++++++++ .../test_sce_mean_weight_log_prob_xnnpack.cc | 32 ++++++++++++++ .../test_sce_mean_weight_xnnpack.cc | 31 +++++++++++++ .../test_xnnpack/test_sce_mean_xnnpack.cc | 30 +++++++++++++ .../test_sce_none_expanded_xnnpack.cc | 30 +++++++++++++ ...test_sce_none_log_prob_expanded_xnnpack.cc | 31 +++++++++++++ .../test_sce_none_log_prob_xnnpack.cc | 31 +++++++++++++ .../test_sce_none_weights_expanded_xnnpack.cc | 31 +++++++++++++ ..._none_weights_log_prob_expanded_xnnpack.cc | 32 ++++++++++++++ .../test_sce_none_weights_log_prob_xnnpack.cc | 32 ++++++++++++++ .../test_sce_none_weights_xnnpack.cc | 31 +++++++++++++ .../test_xnnpack/test_sce_none_xnnpack.cc | 30 +++++++++++++ .../test_sce_sum_expanded_xnnpack.cc | 30 +++++++++++++ .../test_sce_sum_log_prob_expanded_xnnpack.cc | 31 +++++++++++++ .../test_sce_sum_log_prob_xnnpack.cc | 31 +++++++++++++ .../test_xnnpack/test_sce_sum_xnnpack.cc | 30 +++++++++++++ .../test_sequence_insert_at_back_xnnpack.cc | 30 +++++++++++++ .../test_sequence_insert_at_front_xnnpack.cc | 31 +++++++++++++ .../test_slice_negative_axes_xnnpack.cc | 32 ++++++++++++++ .../test_softmax_axis_0_expanded_xnnpack.cc | 29 +++++++++++++ .../test_softmax_axis_1_expanded_xnnpack.cc | 29 +++++++++++++ .../test_softmax_axis_2_expanded_xnnpack.cc | 29 +++++++++++++ ...t_softmax_default_axis_expanded_xnnpack.cc | 29 +++++++++++++ .../test_softmax_example_expanded_xnnpack.cc | 29 +++++++++++++ ...t_softmax_large_number_expanded_xnnpack.cc | 29 +++++++++++++ ..._softmax_negative_axis_expanded_xnnpack.cc | 29 +++++++++++++ .../test_softmax_negative_axis_xnnpack.cc | 29 +++++++++++++ .../test_split_zero_size_splits_xnnpack.cc | 32 ++++++++++++++ .../test_squeeze_negative_axes_xnnpack.cc | 30 +++++++++++++ .../test_top_k_negative_axis_xnnpack.cc | 31 +++++++++++++ .../test_top_k_smallest_xnnpack.cc | 31 +++++++++++++ ...t_training_dropout_default_mask_xnnpack.cc | 32 ++++++++++++++ .../test_training_dropout_default_xnnpack.cc | 31 +++++++++++++ .../test_training_dropout_mask_xnnpack.cc | 32 ++++++++++++++ .../test_training_dropout_xnnpack.cc | 31 +++++++++++++ ...raining_dropout_zero_ratio_mask_xnnpack.cc | 32 ++++++++++++++ ...est_training_dropout_zero_ratio_xnnpack.cc | 31 +++++++++++++ ..._unique_not_sorted_without_axis_xnnpack.cc | 32 ++++++++++++++ ...test_unique_sorted_with_axis_3d_xnnpack.cc | 32 ++++++++++++++ .../test_unique_sorted_with_axis_xnnpack.cc | 32 ++++++++++++++ ...nique_sorted_with_negative_axis_xnnpack.cc | 32 ++++++++++++++ ...test_unique_sorted_without_axis_xnnpack.cc | 32 ++++++++++++++ .../test_unsqueeze_axis_0_xnnpack.cc | 30 +++++++++++++ .../test_unsqueeze_axis_1_xnnpack.cc | 30 +++++++++++++ .../test_unsqueeze_axis_2_xnnpack.cc | 30 +++++++++++++ .../test_unsqueeze_axis_3_xnnpack.cc | 29 +++++++++++++ .../test_unsqueeze_negative_axes_xnnpack.cc | 30 +++++++++++++ .../test_unsqueeze_three_axes_xnnpack.cc | 30 +++++++++++++ .../test_unsqueeze_two_axes_xnnpack.cc | 30 +++++++++++++ .../test_unsqueeze_unsorted_axes_xnnpack.cc | 30 +++++++++++++ .../test_where_long_example_xnnpack.cc | 31 +++++++++++++ tests/unittests/run_test.py | 6 +-- 1846 files changed, 55933 insertions(+), 3 deletions(-) create mode 100644 tests/unittests/lit_cases/test_dnnl/test_adagrad_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_adagrad_multiple_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_adam_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_adam_multiple_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmax_default_axis_example_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmax_default_axis_random_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmax_keepdims_example_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmax_keepdims_random_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_example_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_random_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmax_no_keepdims_example_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmax_no_keepdims_random_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmin_default_axis_example_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmin_default_axis_random_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmin_keepdims_example_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmin_keepdims_random_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_example_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_random_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmin_no_keepdims_example_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_argmin_no_keepdims_random_select_last_index_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint8_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint8_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_cast_BFLOAT16_to_FLOAT_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_cast_FLOAT_to_BFLOAT16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_celu_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_celu_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_inbounds_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_max_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_min_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_compress_negative_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_concat_1d_axis_negative_1_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_concat_2d_axis_negative_1_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_concat_2d_axis_negative_2_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_1_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_2_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_3_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_constantofshape_int_shape_zero_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_exclusive_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_reverse_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_reverse_exclusive_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_axis_0_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_axis_1_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_negative_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_depthtospace_crd_mode_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_depthtospace_crd_mode_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_depthtospace_dcr_mode_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dequantizelinear_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_det_2d_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_det_nd_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dropout_default_mask_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dropout_default_mask_ratio_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dropout_default_old_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dropout_default_ratio_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dropout_random_old_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_max_adjusted_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_max_adjusted_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_min_adjusted_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_min_adjusted_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_einsum_batch_diagonal_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_einsum_batch_matmul_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_einsum_inner_prod_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_einsum_sum_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_einsum_transpose_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis1_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis2_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis3_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis4_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gather_2d_indices_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gather_elements_0_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gather_elements_1_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gather_elements_negative_indices_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gather_negative_indices_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gathernd_example_float32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gathernd_example_int32_batch_dim1_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gathernd_example_int32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_all_attributes_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_alpha_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_beta_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_default_matrix_bias_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_default_no_bias_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_default_scalar_bias_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_default_single_elem_vector_bias_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_default_vector_bias_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_default_zero_bias_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_transposeA_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_gemm_transposeB_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_greater_equal_bcast_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_greater_equal_bcast_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_greater_equal_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_greater_equal_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_hardmax_negative_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_if_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_if_seq_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_less_equal_bcast_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_less_equal_bcast_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_less_equal_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_less_equal_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_0_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_1_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_2_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_logsoftmax_default_axis_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_logsoftmax_example_1_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_logsoftmax_large_number_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_logsoftmax_negative_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_logsoftmax_negative_axis_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_loop11_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_loop13_seq_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_float16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_float32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_float64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_int16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_int32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_int64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_int8_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_uint16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_uint32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_uint64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_max_uint8_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_maxpool_2d_uint8_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_float16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_float32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_float64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_int16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_int32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_int64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_int8_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_uint16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_uint32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_uint64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_min_uint8_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_broadcast_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_int64_fmod_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int8_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_uint16_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_uint32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_uint64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_mod_uint8_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_momentum_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_momentum_multiple_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nesterov_momentum_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NC_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NC_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_mean_weight_negative_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_mean_weight_negative_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_mean_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_mean_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_sum_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_sum_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_mean_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_sum_weight_high_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_mean_weight_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_none_no_weight_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_onehot_negative_indices_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_onehot_with_negative_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_int32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_int64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_uint32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_uint64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_pow_types_float_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_pow_types_int32_float32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_pow_types_int32_int32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_pow_types_int64_float32_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_pow_types_int64_int64_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_pow_types_int_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_quantizelinear_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_range_float_type_positive_delta_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_range_float_type_positive_delta_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_range_int32_type_negative_delta_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_range_int32_type_negative_delta_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_l1_negative_axes_keep_dims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_l1_negative_axes_keep_dims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_l2_negative_axes_keep_dims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_l2_negative_axes_keep_dims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_exp_negative_axes_keepdims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_exp_negative_axes_keepdims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_negative_axes_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_max_negative_axes_keepdims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_max_negative_axes_keepdims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_mean_negative_axes_keepdims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_mean_negative_axes_keepdims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_min_negative_axes_keepdims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_min_negative_axes_keepdims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_prod_negative_axes_keepdims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_prod_negative_axes_keepdims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_sum_empty_axes_input_noop_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_sum_empty_axes_input_noop_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_sum_negative_axes_keepdims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_sum_negative_axes_keepdims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_sum_square_negative_axes_keepdims_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reduce_sum_square_negative_axes_keepdims_random_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reshape_negative_extended_dims_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reshape_reordered_all_dims_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reshape_reordered_last_dims_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reshape_zero_and_negative_dim_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_reshape_zero_dim_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_align_corners_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_linear_align_corners_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_linear_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_nearest_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_cubic_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_linear_pytorch_half_pixel_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_nearest_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_tf_crop_and_resize_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_align_corners_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_asymmetric_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_linear_align_corners_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_linear_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_nearest_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_cubic_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_ceil_half_pixel_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_floor_align_corners_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_round_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_scatter_elements_with_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_scatter_elements_with_negative_indices_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_scatter_elements_without_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_scatternd_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_none_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_none_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_none_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_none_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_sum_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_sum_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_sum_log_prob_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sce_sum_log_prob_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sequence_insert_at_back_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_sequence_insert_at_front_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_slice_negative_axes_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_softmax_axis_0_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_softmax_axis_1_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_softmax_axis_2_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_softmax_default_axis_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_softmax_example_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_softmax_large_number_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_softmax_negative_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_softmax_negative_axis_expanded_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_split_zero_size_splits_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_squeeze_negative_axes_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_top_k_negative_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_top_k_smallest_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_training_dropout_default_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_training_dropout_default_mask_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_training_dropout_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_training_dropout_mask_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_training_dropout_zero_ratio_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_training_dropout_zero_ratio_mask_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unique_not_sorted_without_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_axis_3d_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_negative_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unique_sorted_without_axis_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_0_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_1_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_2_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_3_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unsqueeze_negative_axes_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unsqueeze_three_axes_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unsqueeze_two_axes_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_unsqueeze_unsorted_axes_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_dnnl/test_where_long_example_dnnl.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_adagrad_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_adagrad_multiple_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_adam_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_adam_multiple_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmax_default_axis_example_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmax_default_axis_random_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmax_keepdims_example_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmax_keepdims_random_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_example_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_random_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmax_no_keepdims_example_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmax_no_keepdims_random_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmin_default_axis_example_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmin_default_axis_random_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmin_keepdims_example_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmin_keepdims_random_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_example_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_random_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmin_no_keepdims_example_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_argmin_no_keepdims_random_select_last_index_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint8_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint8_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_cast_BFLOAT16_to_FLOAT_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_cast_FLOAT_to_BFLOAT16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_celu_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_celu_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_clip_default_int8_inbounds_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_clip_default_int8_max_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_clip_default_int8_min_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_compress_negative_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_concat_1d_axis_negative_1_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_concat_2d_axis_negative_1_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_concat_2d_axis_negative_2_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_1_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_2_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_3_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_constantofshape_int_shape_zero_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_cumsum_1d_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_cumsum_1d_exclusive_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_cumsum_1d_reverse_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_cumsum_1d_reverse_exclusive_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_cumsum_2d_axis_0_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_cumsum_2d_axis_1_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_cumsum_2d_negative_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_depthtospace_crd_mode_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_depthtospace_crd_mode_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_depthtospace_dcr_mode_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dequantizelinear_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_det_2d_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_det_nd_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dropout_default_mask_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dropout_default_mask_ratio_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dropout_default_old_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dropout_default_ratio_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dropout_random_old_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_max_adjusted_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_max_adjusted_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_min_adjusted_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_min_adjusted_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_einsum_batch_diagonal_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_einsum_batch_matmul_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_einsum_inner_prod_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_einsum_sum_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_einsum_transpose_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis1_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis2_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis3_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis4_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gather_2d_indices_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gather_elements_0_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gather_elements_1_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gather_elements_negative_indices_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gather_negative_indices_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gathernd_example_float32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gathernd_example_int32_batch_dim1_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gathernd_example_int32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_all_attributes_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_alpha_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_beta_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_default_matrix_bias_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_default_no_bias_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_default_scalar_bias_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_default_single_elem_vector_bias_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_default_vector_bias_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_default_zero_bias_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_transposeA_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_gemm_transposeB_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_greater_equal_bcast_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_greater_equal_bcast_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_greater_equal_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_greater_equal_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_hardmax_negative_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_if_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_if_seq_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_less_equal_bcast_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_less_equal_bcast_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_less_equal_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_less_equal_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_0_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_1_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_2_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_logsoftmax_default_axis_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_logsoftmax_example_1_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_logsoftmax_large_number_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_logsoftmax_negative_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_logsoftmax_negative_axis_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_loop11_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_loop13_seq_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_float16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_float32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_float64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_int16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_int32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_int64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_int8_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_uint16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_uint32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_uint64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_max_uint8_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_maxpool_2d_uint8_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_float16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_float32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_float64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_int16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_int32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_int64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_int8_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_uint16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_uint32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_uint64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_min_uint8_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_broadcast_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_int64_fmod_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int8_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_uint16_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_uint32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_uint64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_mod_uint8_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_momentum_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_momentum_multiple_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nesterov_momentum_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NC_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NC_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_mean_weight_negative_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_mean_weight_negative_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_mean_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_mean_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_sum_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_sum_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_mean_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_sum_weight_high_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_mean_weight_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_none_no_weight_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_onehot_negative_indices_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_onehot_with_negative_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_pow_types_float32_int32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_pow_types_float32_int64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_pow_types_float32_uint32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_pow_types_float32_uint64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_pow_types_float_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_pow_types_int32_float32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_pow_types_int32_int32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_pow_types_int64_float32_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_pow_types_int64_int64_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_pow_types_int_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_quantizelinear_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_range_float_type_positive_delta_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_range_float_type_positive_delta_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_range_int32_type_negative_delta_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_range_int32_type_negative_delta_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_l1_negative_axes_keep_dims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_l1_negative_axes_keep_dims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_l2_negative_axes_keep_dims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_l2_negative_axes_keep_dims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_exp_negative_axes_keepdims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_exp_negative_axes_keepdims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_negative_axes_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_max_negative_axes_keepdims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_max_negative_axes_keepdims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_mean_negative_axes_keepdims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_mean_negative_axes_keepdims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_min_negative_axes_keepdims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_min_negative_axes_keepdims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_prod_negative_axes_keepdims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_prod_negative_axes_keepdims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_sum_empty_axes_input_noop_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_sum_empty_axes_input_noop_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_sum_negative_axes_keepdims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_sum_negative_axes_keepdims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_sum_square_negative_axes_keepdims_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reduce_sum_square_negative_axes_keepdims_random_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reshape_negative_extended_dims_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reshape_reordered_all_dims_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reshape_reordered_last_dims_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reshape_zero_and_negative_dim_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_reshape_zero_dim_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_align_corners_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_linear_align_corners_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_linear_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_nearest_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_cubic_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_linear_pytorch_half_pixel_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_nearest_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_tf_crop_and_resize_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_align_corners_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_asymmetric_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_linear_align_corners_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_linear_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_nearest_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_cubic_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_ceil_half_pixel_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_floor_align_corners_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_round_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_scatter_elements_with_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_scatter_elements_with_negative_indices_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_scatter_elements_without_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_scatternd_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_none_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_none_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_none_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_none_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_none_weights_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_none_weights_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_none_weights_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_none_weights_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_sum_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_sum_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_sum_log_prob_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sce_sum_log_prob_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sequence_insert_at_back_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_sequence_insert_at_front_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_slice_negative_axes_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_softmax_axis_0_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_softmax_axis_1_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_softmax_axis_2_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_softmax_default_axis_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_softmax_example_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_softmax_large_number_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_softmax_negative_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_softmax_negative_axis_expanded_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_split_zero_size_splits_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_squeeze_negative_axes_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_top_k_negative_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_top_k_smallest_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_training_dropout_default_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_training_dropout_default_mask_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_training_dropout_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_training_dropout_mask_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_training_dropout_zero_ratio_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_training_dropout_zero_ratio_mask_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unique_not_sorted_without_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_axis_3d_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_negative_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unique_sorted_without_axis_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_0_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_1_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_2_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_3_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unsqueeze_negative_axes_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unsqueeze_three_axes_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unsqueeze_two_axes_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_unsqueeze_unsorted_axes_eigen.cc create mode 100644 tests/unittests/lit_cases/test_eigen/test_where_long_example_eigen.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_adagrad_multiple_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_adagrad_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_adam_multiple_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_adam_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmax_default_axis_example_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmax_default_axis_random_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmax_keepdims_example_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmax_keepdims_random_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_example_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_random_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmax_no_keepdims_example_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmax_no_keepdims_random_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmin_default_axis_example_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmin_default_axis_random_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmin_keepdims_example_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmin_keepdims_random_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_example_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_random_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmin_no_keepdims_example_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_argmin_no_keepdims_random_select_last_index_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_bitshift_left_uint16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_bitshift_left_uint32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_bitshift_left_uint64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_bitshift_left_uint8_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_bitshift_right_uint16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_bitshift_right_uint32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_bitshift_right_uint64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_bitshift_right_uint8_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_cast_BFLOAT16_to_FLOAT_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_cast_FLOAT_to_BFLOAT16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_celu_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_celu_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_clip_default_int8_inbounds_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_clip_default_int8_max_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_clip_default_int8_min_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_compress_negative_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_concat_1d_axis_negative_1_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_concat_2d_axis_negative_1_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_concat_2d_axis_negative_2_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_1_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_2_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_3_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_constantofshape_int_shape_zero_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_cumsum_1d_exclusive_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_cumsum_1d_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_cumsum_1d_reverse_exclusive_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_cumsum_1d_reverse_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_cumsum_2d_axis_0_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_cumsum_2d_axis_1_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_cumsum_2d_negative_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_depthtospace_crd_mode_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_depthtospace_crd_mode_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_depthtospace_dcr_mode_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dequantizelinear_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_det_2d_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_det_nd_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dropout_default_mask_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dropout_default_mask_ratio_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dropout_default_old_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dropout_default_ratio_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dropout_random_old_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_max_adjusted_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_max_adjusted_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_min_adjusted_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_min_adjusted_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_einsum_batch_diagonal_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_einsum_batch_matmul_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_einsum_inner_prod_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_einsum_sum_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_einsum_transpose_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_flatten_negative_axis1_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_flatten_negative_axis2_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_flatten_negative_axis3_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_flatten_negative_axis4_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gather_2d_indices_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gather_elements_0_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gather_elements_1_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gather_elements_negative_indices_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gather_negative_indices_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gathernd_example_float32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gathernd_example_int32_batch_dim1_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gathernd_example_int32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_all_attributes_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_alpha_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_beta_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_default_matrix_bias_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_default_no_bias_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_default_scalar_bias_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_default_single_elem_vector_bias_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_default_vector_bias_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_default_zero_bias_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_transposeA_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_gemm_transposeB_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_greater_equal_bcast_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_greater_equal_bcast_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_greater_equal_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_greater_equal_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_hardmax_negative_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_if_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_if_seq_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_less_equal_bcast_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_less_equal_bcast_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_less_equal_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_less_equal_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_0_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_1_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_2_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_logsoftmax_default_axis_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_logsoftmax_example_1_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_logsoftmax_large_number_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_logsoftmax_negative_axis_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_logsoftmax_negative_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_loop11_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_loop13_seq_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_float16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_float32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_float64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_int16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_int32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_int64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_int8_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_uint16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_uint32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_uint64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_max_uint8_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_maxpool_2d_uint8_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_float16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_float32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_float64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_int16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_int32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_int64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_int8_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_uint16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_uint32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_uint64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_min_uint8_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_broadcast_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_int64_fmod_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int8_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_uint16_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_uint32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_uint64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_mod_uint8_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_momentum_multiple_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_momentum_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nesterov_momentum_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NC_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NC_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_mean_weight_negative_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_mean_weight_negative_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_mean_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_mean_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_sum_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_sum_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_mean_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_sum_weight_high_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_mean_weight_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_none_no_weight_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_onehot_negative_indices_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_onehot_with_negative_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_pow_types_float32_int32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_pow_types_float32_int64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_pow_types_float32_uint32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_pow_types_float32_uint64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_pow_types_float_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_pow_types_int32_float32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_pow_types_int32_int32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_pow_types_int64_float32_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_pow_types_int64_int64_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_pow_types_int_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_quantizelinear_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_range_float_type_positive_delta_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_range_float_type_positive_delta_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_range_int32_type_negative_delta_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_range_int32_type_negative_delta_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_l1_negative_axes_keep_dims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_l1_negative_axes_keep_dims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_l2_negative_axes_keep_dims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_l2_negative_axes_keep_dims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_log_sum_exp_negative_axes_keepdims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_log_sum_exp_negative_axes_keepdims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_log_sum_negative_axes_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_max_negative_axes_keepdims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_max_negative_axes_keepdims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_mean_negative_axes_keepdims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_mean_negative_axes_keepdims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_min_negative_axes_keepdims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_min_negative_axes_keepdims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_prod_negative_axes_keepdims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_prod_negative_axes_keepdims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_sum_empty_axes_input_noop_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_sum_empty_axes_input_noop_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_sum_negative_axes_keepdims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_sum_negative_axes_keepdims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_sum_square_negative_axes_keepdims_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reduce_sum_square_negative_axes_keepdims_random_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reshape_negative_extended_dims_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reshape_reordered_all_dims_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reshape_reordered_last_dims_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reshape_zero_and_negative_dim_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_reshape_zero_dim_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_align_corners_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_linear_align_corners_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_linear_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_nearest_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_cubic_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_linear_pytorch_half_pixel_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_nearest_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_tf_crop_and_resize_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_align_corners_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_asymmetric_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_linear_align_corners_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_linear_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_nearest_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_cubic_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_ceil_half_pixel_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_floor_align_corners_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_round_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_scatter_elements_with_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_scatter_elements_with_negative_indices_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_scatter_elements_without_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_scatternd_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_3d_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_3d_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_3d_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_3d_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_mean_weight_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_none_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_none_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_none_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_none_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_none_weights_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_none_weights_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_none_weights_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_none_weights_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_sum_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_sum_log_prob_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_sum_log_prob_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sce_sum_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sequence_insert_at_back_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_sequence_insert_at_front_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_slice_negative_axes_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_softmax_axis_0_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_softmax_axis_1_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_softmax_axis_2_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_softmax_default_axis_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_softmax_example_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_softmax_large_number_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_softmax_negative_axis_expanded_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_softmax_negative_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_split_zero_size_splits_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_squeeze_negative_axes_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_top_k_negative_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_top_k_smallest_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_training_dropout_default_mask_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_training_dropout_default_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_training_dropout_mask_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_training_dropout_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_training_dropout_zero_ratio_mask_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_training_dropout_zero_ratio_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unique_not_sorted_without_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unique_sorted_with_axis_3d_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unique_sorted_with_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unique_sorted_with_negative_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unique_sorted_without_axis_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_0_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_1_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_2_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_3_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unsqueeze_negative_axes_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unsqueeze_three_axes_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unsqueeze_two_axes_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_unsqueeze_unsorted_axes_popart.cc create mode 100644 tests/unittests/lit_cases/test_popart/test_where_long_example_popart.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_adagrad_multiple_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_adagrad_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_adam_multiple_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_adam_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmax_default_axis_example_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmax_default_axis_random_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmax_keepdims_example_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmax_keepdims_random_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_example_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_random_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmax_no_keepdims_example_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmax_no_keepdims_random_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmin_default_axis_example_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmin_default_axis_random_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmin_keepdims_example_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmin_keepdims_random_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_example_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_random_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmin_no_keepdims_example_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_argmin_no_keepdims_random_select_last_index_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint8_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint8_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_cast_BFLOAT16_to_FLOAT_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_cast_FLOAT_to_BFLOAT16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_celu_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_celu_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_inbounds_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_max_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_min_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_compress_negative_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_concat_1d_axis_negative_1_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_concat_2d_axis_negative_1_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_concat_2d_axis_negative_2_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_1_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_2_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_3_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_constantofshape_int_shape_zero_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_exclusive_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_reverse_exclusive_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_reverse_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_axis_0_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_axis_1_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_negative_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_depthtospace_crd_mode_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_depthtospace_crd_mode_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_depthtospace_dcr_mode_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dequantizelinear_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_det_2d_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_det_nd_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dropout_default_mask_ratio_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dropout_default_mask_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dropout_default_old_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dropout_default_ratio_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dropout_random_old_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_max_adjusted_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_max_adjusted_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_min_adjusted_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_min_adjusted_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_einsum_batch_diagonal_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_einsum_batch_matmul_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_einsum_inner_prod_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_einsum_sum_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_einsum_transpose_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis1_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis2_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis3_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis4_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gather_2d_indices_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gather_elements_0_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gather_elements_1_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gather_elements_negative_indices_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gather_negative_indices_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_float32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_int32_batch_dim1_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_int32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_all_attributes_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_alpha_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_beta_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_default_matrix_bias_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_default_no_bias_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_default_scalar_bias_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_default_single_elem_vector_bias_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_default_vector_bias_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_default_zero_bias_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_transposeA_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_gemm_transposeB_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_greater_equal_bcast_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_greater_equal_bcast_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_greater_equal_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_greater_equal_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_hardmax_negative_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_if_seq_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_if_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_less_equal_bcast_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_less_equal_bcast_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_less_equal_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_less_equal_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_0_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_1_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_2_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_default_axis_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_example_1_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_large_number_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_negative_axis_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_negative_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_loop11_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_loop13_seq_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_float16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_float32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_float64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_int16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_int32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_int64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_int8_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_uint16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_uint32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_uint64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_max_uint8_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_maxpool_2d_uint8_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_float16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_float32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_float64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_int16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_int32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_int64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_int8_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_uint16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_uint32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_uint64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_min_uint8_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_broadcast_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_int64_fmod_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int8_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_uint16_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_uint32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_uint64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_mod_uint8_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_momentum_multiple_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_momentum_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nesterov_momentum_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NC_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NC_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_mean_weight_negative_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_mean_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_mean_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_sum_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_sum_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_mean_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_sum_weight_high_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_mean_weight_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_none_no_weight_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_onehot_negative_indices_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_onehot_with_negative_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_int32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_int64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_uint32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_uint64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_pow_types_float_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_pow_types_int32_float32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_pow_types_int32_int32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_pow_types_int64_float32_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_pow_types_int64_int64_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_pow_types_int_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_quantizelinear_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_range_float_type_positive_delta_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_range_float_type_positive_delta_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_range_int32_type_negative_delta_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_range_int32_type_negative_delta_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_l1_negative_axes_keep_dims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_l1_negative_axes_keep_dims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_l2_negative_axes_keep_dims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_l2_negative_axes_keep_dims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_exp_negative_axes_keepdims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_exp_negative_axes_keepdims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_negative_axes_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_max_negative_axes_keepdims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_max_negative_axes_keepdims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_mean_negative_axes_keepdims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_mean_negative_axes_keepdims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_min_negative_axes_keepdims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_min_negative_axes_keepdims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_negative_axes_keepdims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_negative_axes_keepdims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_empty_axes_input_noop_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_empty_axes_input_noop_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_negative_axes_keepdims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_negative_axes_keepdims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_square_negative_axes_keepdims_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_square_negative_axes_keepdims_random_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reshape_negative_extended_dims_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reshape_reordered_all_dims_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reshape_reordered_last_dims_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reshape_zero_and_negative_dim_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_reshape_zero_dim_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_align_corners_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_linear_align_corners_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_linear_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_nearest_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_cubic_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_linear_pytorch_half_pixel_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_nearest_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_tf_crop_and_resize_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_align_corners_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_asymmetric_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_linear_align_corners_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_linear_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_nearest_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_cubic_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_ceil_half_pixel_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_floor_align_corners_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_round_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_with_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_with_negative_indices_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_without_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_scatternd_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_none_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_none_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_none_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_none_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_sum_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_sum_log_prob_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_sum_log_prob_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sce_sum_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sequence_insert_at_back_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_sequence_insert_at_front_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_slice_negative_axes_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_0_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_1_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_2_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_softmax_default_axis_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_softmax_example_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_softmax_large_number_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_softmax_negative_axis_expanded_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_softmax_negative_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_split_zero_size_splits_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_squeeze_negative_axes_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_top_k_negative_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_top_k_smallest_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_training_dropout_default_mask_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_training_dropout_default_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_training_dropout_mask_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_training_dropout_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_training_dropout_zero_ratio_mask_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_training_dropout_zero_ratio_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unique_not_sorted_without_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_axis_3d_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_negative_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_without_axis_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_0_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_1_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_2_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_3_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_negative_axes_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_three_axes_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_two_axes_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_unsorted_axes_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_tensorrt/test_where_long_example_tensorrt.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_adagrad_multiple_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_adagrad_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_adam_multiple_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_adam_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmax_default_axis_example_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmax_default_axis_random_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmax_keepdims_example_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmax_keepdims_random_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_example_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_random_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmax_no_keepdims_example_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmax_no_keepdims_random_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmin_default_axis_example_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmin_default_axis_random_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmin_keepdims_example_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmin_keepdims_random_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_example_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_random_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmin_no_keepdims_example_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_argmin_no_keepdims_random_select_last_index_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint8_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint8_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_cast_BFLOAT16_to_FLOAT_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_cast_FLOAT_to_BFLOAT16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_celu_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_celu_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_inbounds_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_max_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_min_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_compress_negative_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_concat_1d_axis_negative_1_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_concat_2d_axis_negative_1_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_concat_2d_axis_negative_2_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_1_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_2_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_3_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_constantofshape_int_shape_zero_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_exclusive_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_reverse_exclusive_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_reverse_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_axis_0_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_axis_1_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_negative_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_depthtospace_crd_mode_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_depthtospace_crd_mode_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_depthtospace_dcr_mode_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dequantizelinear_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_det_2d_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_det_nd_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dropout_default_mask_ratio_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dropout_default_mask_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dropout_default_old_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dropout_default_ratio_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dropout_random_old_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_max_adjusted_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_max_adjusted_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_min_adjusted_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_min_adjusted_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_einsum_batch_diagonal_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_einsum_batch_matmul_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_einsum_inner_prod_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_einsum_sum_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_einsum_transpose_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis1_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis2_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis3_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis4_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gather_2d_indices_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gather_elements_0_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gather_elements_1_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gather_elements_negative_indices_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gather_negative_indices_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_float32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_int32_batch_dim1_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_int32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_all_attributes_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_alpha_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_beta_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_default_matrix_bias_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_default_no_bias_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_default_scalar_bias_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_default_single_elem_vector_bias_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_default_vector_bias_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_default_zero_bias_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_transposeA_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_gemm_transposeB_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_greater_equal_bcast_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_greater_equal_bcast_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_greater_equal_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_greater_equal_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_hardmax_negative_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_if_seq_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_if_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_less_equal_bcast_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_less_equal_bcast_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_less_equal_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_less_equal_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_0_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_1_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_2_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_default_axis_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_example_1_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_large_number_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_negative_axis_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_negative_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_loop11_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_loop13_seq_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_float16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_float32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_float64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_int16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_int32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_int64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_int8_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_uint16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_uint32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_uint64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_max_uint8_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_maxpool_2d_uint8_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_float16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_float32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_float64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_int16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_int32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_int64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_int8_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_uint16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_uint32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_uint64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_min_uint8_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_broadcast_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_int64_fmod_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int8_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_uint16_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_uint32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_uint64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_mod_uint8_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_momentum_multiple_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_momentum_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nesterov_momentum_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NC_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NC_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_mean_weight_negative_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_mean_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_mean_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_sum_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_sum_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_mean_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_sum_weight_high_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_mean_weight_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_none_no_weight_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_onehot_negative_indices_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_onehot_with_negative_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_int32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_int64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_uint32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_uint64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_pow_types_float_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_pow_types_int32_float32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_pow_types_int32_int32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_pow_types_int64_float32_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_pow_types_int64_int64_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_pow_types_int_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_quantizelinear_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_range_float_type_positive_delta_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_range_float_type_positive_delta_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_range_int32_type_negative_delta_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_range_int32_type_negative_delta_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_l1_negative_axes_keep_dims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_l1_negative_axes_keep_dims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_l2_negative_axes_keep_dims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_l2_negative_axes_keep_dims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_exp_negative_axes_keepdims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_exp_negative_axes_keepdims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_negative_axes_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_max_negative_axes_keepdims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_max_negative_axes_keepdims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_mean_negative_axes_keepdims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_mean_negative_axes_keepdims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_min_negative_axes_keepdims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_min_negative_axes_keepdims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_prod_negative_axes_keepdims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_prod_negative_axes_keepdims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_empty_axes_input_noop_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_empty_axes_input_noop_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_negative_axes_keepdims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_negative_axes_keepdims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_square_negative_axes_keepdims_example_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_square_negative_axes_keepdims_random_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reshape_negative_extended_dims_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reshape_reordered_all_dims_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reshape_reordered_last_dims_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reshape_zero_and_negative_dim_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_reshape_zero_dim_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_align_corners_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_linear_align_corners_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_linear_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_nearest_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_cubic_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_linear_pytorch_half_pixel_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_nearest_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_tf_crop_and_resize_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_align_corners_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_asymmetric_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_linear_align_corners_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_linear_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_nearest_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_cubic_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_ceil_half_pixel_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_floor_align_corners_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_round_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_with_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_with_negative_indices_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_without_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_scatternd_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_mean_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_none_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_none_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_none_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_none_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_sum_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_sum_log_prob_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_sum_log_prob_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sce_sum_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sequence_insert_at_back_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_sequence_insert_at_front_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_slice_negative_axes_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_0_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_1_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_2_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_softmax_default_axis_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_softmax_example_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_softmax_large_number_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_softmax_negative_axis_expanded_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_softmax_negative_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_split_zero_size_splits_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_squeeze_negative_axes_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_top_k_negative_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_top_k_smallest_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_training_dropout_default_mask_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_training_dropout_default_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_training_dropout_mask_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_training_dropout_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_training_dropout_zero_ratio_mask_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_training_dropout_zero_ratio_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unique_not_sorted_without_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_axis_3d_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_negative_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_without_axis_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_0_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_1_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_2_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_3_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_negative_axes_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_three_axes_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_two_axes_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_unsorted_axes_xnnpack.cc create mode 100644 tests/unittests/lit_cases/test_xnnpack/test_where_long_example_xnnpack.cc diff --git a/tests/unittests/lit_cases/test_dnnl/test_adagrad_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_adagrad_dnnl.cc new file mode 100644 index 000000000..eefb9aff1 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_adagrad_dnnl.cc @@ -0,0 +1,34 @@ +//===-test_adagrad_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adagrad/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adagrad/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_adagrad | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adagrad_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_adagrad_multiple_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_adagrad_multiple_dnnl.cc new file mode 100644 index 000000000..2f1a3fe13 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_adagrad_multiple_dnnl.cc @@ -0,0 +1,39 @@ +//===-test_adagrad_multiple_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adagrad_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adagrad_multiple/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_adagrad_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adagrad_multiple_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_adam_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_adam_dnnl.cc new file mode 100644 index 000000000..ad3fc8a4c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_adam_dnnl.cc @@ -0,0 +1,36 @@ +//===-test_adam_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adam/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adam/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_adam | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adam_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_adam_multiple_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_adam_multiple_dnnl.cc new file mode 100644 index 000000000..74f2d2128 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_adam_multiple_dnnl.cc @@ -0,0 +1,43 @@ +//===-test_adam_multiple_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_4.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_8.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_8.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_9.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_9.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_5.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_5.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adam_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adam_multiple/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_adam_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adam_multiple_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmax_default_axis_example_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmax_default_axis_example_select_last_index_dnnl.cc new file mode 100644 index 000000000..7d373d61e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmax_default_axis_example_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmax_default_axis_example_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_default_axis_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmax_default_axis_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_default_axis_example_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmax_default_axis_random_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmax_default_axis_random_select_last_index_dnnl.cc new file mode 100644 index 000000000..3f8c4145f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmax_default_axis_random_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmax_default_axis_random_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_default_axis_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmax_default_axis_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_default_axis_random_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmax_keepdims_example_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmax_keepdims_example_select_last_index_dnnl.cc new file mode 100644 index 000000000..e5a7e5c87 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmax_keepdims_example_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmax_keepdims_example_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmax_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_keepdims_example_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmax_keepdims_random_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmax_keepdims_random_select_last_index_dnnl.cc new file mode 100644 index 000000000..c9f4b2d87 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmax_keepdims_random_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmax_keepdims_random_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmax_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_keepdims_random_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_example_dnnl.cc new file mode 100644 index 000000000..50d9b317c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmax_negative_axis_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_example_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_example_select_last_index_dnnl.cc new file mode 100644 index 000000000..fb81613f1 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_example_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_example_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmax_negative_axis_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_example_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_random_dnnl.cc new file mode 100644 index 000000000..128a0f4bc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_random_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmax_negative_axis_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_random_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_random_select_last_index_dnnl.cc new file mode 100644 index 000000000..5c6c41963 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmax_negative_axis_keepdims_random_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_random_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmax_negative_axis_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_random_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmax_no_keepdims_example_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmax_no_keepdims_example_select_last_index_dnnl.cc new file mode 100644 index 000000000..8197d7d73 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmax_no_keepdims_example_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmax_no_keepdims_example_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_no_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmax_no_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_no_keepdims_example_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmax_no_keepdims_random_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmax_no_keepdims_random_select_last_index_dnnl.cc new file mode 100644 index 000000000..4d477cdfe --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmax_no_keepdims_random_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmax_no_keepdims_random_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_no_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmax_no_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_no_keepdims_random_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmin_default_axis_example_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmin_default_axis_example_select_last_index_dnnl.cc new file mode 100644 index 000000000..10bf5f8b2 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmin_default_axis_example_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmin_default_axis_example_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_default_axis_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmin_default_axis_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_default_axis_example_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmin_default_axis_random_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmin_default_axis_random_select_last_index_dnnl.cc new file mode 100644 index 000000000..cb86551a9 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmin_default_axis_random_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmin_default_axis_random_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_default_axis_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmin_default_axis_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_default_axis_random_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmin_keepdims_example_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmin_keepdims_example_select_last_index_dnnl.cc new file mode 100644 index 000000000..7acf9cd90 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmin_keepdims_example_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmin_keepdims_example_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmin_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_keepdims_example_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmin_keepdims_random_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmin_keepdims_random_select_last_index_dnnl.cc new file mode 100644 index 000000000..ffafc7903 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmin_keepdims_random_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmin_keepdims_random_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmin_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_keepdims_random_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_example_dnnl.cc new file mode 100644 index 000000000..8c8b46fe4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmin_negative_axis_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_example_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_example_select_last_index_dnnl.cc new file mode 100644 index 000000000..b205c9b9c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_example_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_example_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmin_negative_axis_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_example_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_random_dnnl.cc new file mode 100644 index 000000000..e44fca1b8 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_random_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmin_negative_axis_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_random_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_random_select_last_index_dnnl.cc new file mode 100644 index 000000000..d9ded5417 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmin_negative_axis_keepdims_random_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_random_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmin_negative_axis_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_random_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmin_no_keepdims_example_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmin_no_keepdims_example_select_last_index_dnnl.cc new file mode 100644 index 000000000..4c6260956 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmin_no_keepdims_example_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmin_no_keepdims_example_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_no_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmin_no_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_no_keepdims_example_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_argmin_no_keepdims_random_select_last_index_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_argmin_no_keepdims_random_select_last_index_dnnl.cc new file mode 100644 index 000000000..2d0b30dae --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_argmin_no_keepdims_random_select_last_index_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_argmin_no_keepdims_random_select_last_index_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_no_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_argmin_no_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_no_keepdims_random_select_last_index_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint16_dnnl.cc new file mode 100644 index 000000000..731dcad57 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_bitshift_left_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint32_dnnl.cc new file mode 100644 index 000000000..62f886961 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_bitshift_left_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint64_dnnl.cc new file mode 100644 index 000000000..5518c6093 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_bitshift_left_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint8_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint8_dnnl.cc new file mode 100644 index 000000000..4b552219e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_bitshift_left_uint8_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint8_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint8/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_bitshift_left_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint8_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint16_dnnl.cc new file mode 100644 index 000000000..904e23562 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_bitshift_right_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint32_dnnl.cc new file mode 100644 index 000000000..810304924 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_bitshift_right_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint64_dnnl.cc new file mode 100644 index 000000000..e4460ad9f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_bitshift_right_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint8_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint8_dnnl.cc new file mode 100644 index 000000000..88872a3f5 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_bitshift_right_uint8_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint8_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint8/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_bitshift_right_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint8_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_cast_BFLOAT16_to_FLOAT_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_cast_BFLOAT16_to_FLOAT_dnnl.cc new file mode 100644 index 000000000..316a7ed19 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_cast_BFLOAT16_to_FLOAT_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_cast_BFLOAT16_to_FLOAT_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cast_BFLOAT16_to_FLOAT/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_cast_BFLOAT16_to_FLOAT | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cast_BFLOAT16_to_FLOAT_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_cast_FLOAT_to_BFLOAT16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_cast_FLOAT_to_BFLOAT16_dnnl.cc new file mode 100644 index 000000000..fcd13fc81 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_cast_FLOAT_to_BFLOAT16_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_cast_FLOAT_to_BFLOAT16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cast_FLOAT_to_BFLOAT16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_cast_FLOAT_to_BFLOAT16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cast_FLOAT_to_BFLOAT16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_celu_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_celu_dnnl.cc new file mode 100644 index 000000000..6f345a757 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_celu_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_celu_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_celu/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_celu/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_celu/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_celu/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_celu/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_celu/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_celu | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_celu_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_celu_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_celu_expanded_dnnl.cc new file mode 100644 index 000000000..924bcf2b4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_celu_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_celu_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_celu_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_celu_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_celu_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_celu_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_celu_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_celu_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_celu_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_celu_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_inbounds_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_inbounds_dnnl.cc new file mode 100644 index 000000000..0f52ac4e1 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_inbounds_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_clip_default_int8_inbounds_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_inbounds/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_inbounds/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_inbounds/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_inbounds/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_inbounds/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_inbounds/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_clip_default_int8_inbounds | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_inbounds_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_max_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_max_dnnl.cc new file mode 100644 index 000000000..5211ec74b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_max_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_clip_default_int8_max_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_max/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_max/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_clip_default_int8_max | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_max_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_min_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_min_dnnl.cc new file mode 100644 index 000000000..171694da3 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_clip_default_int8_min_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_clip_default_int8_min_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_min/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_min/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_clip_default_int8_min | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_min_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_compress_negative_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_compress_negative_axis_dnnl.cc new file mode 100644 index 000000000..667f4c727 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_compress_negative_axis_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_compress_negative_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_compress_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_compress_negative_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_compress_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_compress_negative_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_concat_1d_axis_negative_1_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_concat_1d_axis_negative_1_dnnl.cc new file mode 100644 index 000000000..69ecfa8cc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_concat_1d_axis_negative_1_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_concat_1d_axis_negative_1_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_1d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_1d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_concat_1d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_1d_axis_negative_1_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_concat_2d_axis_negative_1_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_concat_2d_axis_negative_1_dnnl.cc new file mode 100644 index 000000000..8efd5fd82 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_concat_2d_axis_negative_1_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_concat_2d_axis_negative_1_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_2d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_2d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_concat_2d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_2d_axis_negative_1_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_concat_2d_axis_negative_2_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_concat_2d_axis_negative_2_dnnl.cc new file mode 100644 index 000000000..8510f6443 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_concat_2d_axis_negative_2_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_concat_2d_axis_negative_2_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_2d_axis_negative_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_2d_axis_negative_2/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_concat_2d_axis_negative_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_2d_axis_negative_2_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_1_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_1_dnnl.cc new file mode 100644 index 000000000..a72fbc649 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_1_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_1_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_concat_3d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_1_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_2_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_2_dnnl.cc new file mode 100644 index 000000000..f6ae7d6a1 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_2_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_2_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_2/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_concat_3d_axis_negative_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_2_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_3_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_3_dnnl.cc new file mode 100644 index 000000000..51ac8b39c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_concat_3d_axis_negative_3_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_3_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_3/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_concat_3d_axis_negative_3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_3_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_constantofshape_int_shape_zero_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_constantofshape_int_shape_zero_dnnl.cc new file mode 100644 index 000000000..2d69c4fc9 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_constantofshape_int_shape_zero_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_constantofshape_int_shape_zero_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_constantofshape_int_shape_zero/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_constantofshape_int_shape_zero/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_constantofshape_int_shape_zero/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_constantofshape_int_shape_zero/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_constantofshape_int_shape_zero/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_constantofshape_int_shape_zero/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_constantofshape_int_shape_zero | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_constantofshape_int_shape_zero_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_dnnl.cc new file mode 100644 index 000000000..aabece67c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_cumsum_1d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_exclusive_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_exclusive_dnnl.cc new file mode 100644 index 000000000..a80689960 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_exclusive_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_exclusive_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_exclusive/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_exclusive/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_cumsum_1d_exclusive | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_exclusive_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_reverse_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_reverse_dnnl.cc new file mode 100644 index 000000000..181e04866 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_reverse_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_reverse_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_reverse/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_reverse/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_cumsum_1d_reverse | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_reverse_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_reverse_exclusive_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_reverse_exclusive_dnnl.cc new file mode 100644 index 000000000..c334601e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_cumsum_1d_reverse_exclusive_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_reverse_exclusive_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_reverse_exclusive/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_cumsum_1d_reverse_exclusive | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_reverse_exclusive_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_axis_0_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_axis_0_dnnl.cc new file mode 100644 index 000000000..d2db0a647 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_axis_0_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_axis_0_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_axis_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_axis_0/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_cumsum_2d_axis_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_axis_0_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_axis_1_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_axis_1_dnnl.cc new file mode 100644 index 000000000..5dfa33ab4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_axis_1_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_axis_1_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_axis_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_axis_1/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_cumsum_2d_axis_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_axis_1_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_negative_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_negative_axis_dnnl.cc new file mode 100644 index 000000000..dd1818719 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_cumsum_2d_negative_axis_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_negative_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_negative_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_cumsum_2d_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_negative_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_depthtospace_crd_mode_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_depthtospace_crd_mode_dnnl.cc new file mode 100644 index 000000000..47fb188f6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_depthtospace_crd_mode_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_crd_mode_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_crd_mode/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_crd_mode/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_depthtospace_crd_mode | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_crd_mode_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_depthtospace_crd_mode_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_depthtospace_crd_mode_example_dnnl.cc new file mode 100644 index 000000000..2db758884 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_depthtospace_crd_mode_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_crd_mode_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_crd_mode_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_crd_mode_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_depthtospace_crd_mode_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_crd_mode_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_depthtospace_dcr_mode_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_depthtospace_dcr_mode_dnnl.cc new file mode 100644 index 000000000..a1b206f01 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_depthtospace_dcr_mode_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_dcr_mode_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_dcr_mode/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_dcr_mode/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_dcr_mode/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_dcr_mode/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_dcr_mode/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_dcr_mode/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_depthtospace_dcr_mode | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_dcr_mode_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dequantizelinear_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dequantizelinear_axis_dnnl.cc new file mode 100644 index 000000000..3a11d2aba --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dequantizelinear_axis_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_dequantizelinear_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dequantizelinear_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dequantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dequantizelinear_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dequantizelinear_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_det_2d_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_det_2d_dnnl.cc new file mode 100644 index 000000000..d7a222398 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_det_2d_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_det_2d_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_det_2d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_det_2d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_det_2d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_det_2d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_det_2d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_det_2d/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_det_2d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_det_2d_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_det_nd_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_det_nd_dnnl.cc new file mode 100644 index 000000000..c2b9625d7 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_det_nd_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_det_nd_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_det_nd/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_det_nd/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_det_nd/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_det_nd/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_det_nd/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_det_nd/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_det_nd | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_det_nd_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dropout_default_mask_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dropout_default_mask_dnnl.cc new file mode 100644 index 000000000..ec23d4ead --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dropout_default_mask_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_dropout_default_mask_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_mask/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dropout_default_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_mask_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dropout_default_mask_ratio_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dropout_default_mask_ratio_dnnl.cc new file mode 100644 index 000000000..eebe3a68e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dropout_default_mask_ratio_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_dropout_default_mask_ratio_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_mask_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_mask_ratio/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dropout_default_mask_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_mask_ratio_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dropout_default_old_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dropout_default_old_dnnl.cc new file mode 100644 index 000000000..2eb522799 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dropout_default_old_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_dropout_default_old_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_old/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_old/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_old/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_old/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_old/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_old/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dropout_default_old | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_old_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dropout_default_ratio_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dropout_default_ratio_dnnl.cc new file mode 100644 index 000000000..2c454bc0f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dropout_default_ratio_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_dropout_default_ratio_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_ratio/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dropout_default_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_ratio_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dropout_random_old_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dropout_random_old_dnnl.cc new file mode 100644 index 000000000..910794aec --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dropout_random_old_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_dropout_random_old_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_random_old/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_random_old/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_random_old/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_random_old/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_random_old/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_random_old/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dropout_random_old | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_random_old_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_dnnl.cc new file mode 100644 index 000000000..2876158dc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dynamicquantizelinear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_expanded_dnnl.cc new file mode 100644 index 000000000..56720cd32 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dynamicquantizelinear_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_max_adjusted_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_max_adjusted_dnnl.cc new file mode 100644 index 000000000..00ad5f81b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_max_adjusted_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_max_adjusted_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_max_adjusted/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dynamicquantizelinear_max_adjusted | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_max_adjusted_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_max_adjusted_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_max_adjusted_expanded_dnnl.cc new file mode 100644 index 000000000..096aa6adc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_max_adjusted_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_max_adjusted_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_max_adjusted_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dynamicquantizelinear_max_adjusted_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_max_adjusted_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_min_adjusted_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_min_adjusted_dnnl.cc new file mode 100644 index 000000000..79e1e3488 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_min_adjusted_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_min_adjusted_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_min_adjusted/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dynamicquantizelinear_min_adjusted | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_min_adjusted_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_min_adjusted_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_min_adjusted_expanded_dnnl.cc new file mode 100644 index 000000000..567987ee4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_dynamicquantizelinear_min_adjusted_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_min_adjusted_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_min_adjusted_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dynamicquantizelinear_min_adjusted_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_min_adjusted_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_einsum_batch_diagonal_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_einsum_batch_diagonal_dnnl.cc new file mode 100644 index 000000000..3481132fc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_einsum_batch_diagonal_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_einsum_batch_diagonal_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_diagonal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_diagonal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_diagonal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_diagonal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_batch_diagonal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_batch_diagonal/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_einsum_batch_diagonal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_batch_diagonal_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_einsum_batch_matmul_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_einsum_batch_matmul_dnnl.cc new file mode 100644 index 000000000..f7ab7906c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_einsum_batch_matmul_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_einsum_batch_matmul_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_batch_matmul/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_batch_matmul/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_einsum_batch_matmul | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_batch_matmul_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_einsum_inner_prod_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_einsum_inner_prod_dnnl.cc new file mode 100644 index 000000000..f43b64c98 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_einsum_inner_prod_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_einsum_inner_prod_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_inner_prod/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_inner_prod/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_einsum_inner_prod | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_inner_prod_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_einsum_sum_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_einsum_sum_dnnl.cc new file mode 100644 index 000000000..244b3db0e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_einsum_sum_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_einsum_sum_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_sum/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_einsum_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_sum_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_einsum_transpose_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_einsum_transpose_dnnl.cc new file mode 100644 index 000000000..a0312ceeb --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_einsum_transpose_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_einsum_transpose_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_transpose/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_transpose/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_transpose/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_transpose/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_transpose/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_transpose/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_einsum_transpose | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_transpose_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis1_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis1_dnnl.cc new file mode 100644 index 000000000..55b34cda6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis1_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis1_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis1/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_flatten_negative_axis1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis1_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis2_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis2_dnnl.cc new file mode 100644 index 000000000..c17fb626f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis2_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis2_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis2/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_flatten_negative_axis2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis2_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis3_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis3_dnnl.cc new file mode 100644 index 000000000..0dc25d60c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis3_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis3_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis3/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_flatten_negative_axis3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis3_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis4_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis4_dnnl.cc new file mode 100644 index 000000000..a4d87e8ca --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_flatten_negative_axis4_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis4_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis4/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis4/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis4/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis4/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis4/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis4/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_flatten_negative_axis4 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis4_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gather_2d_indices_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gather_2d_indices_dnnl.cc new file mode 100644 index 000000000..182bcfff1 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gather_2d_indices_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_gather_2d_indices_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_2d_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_2d_indices/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gather_2d_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_2d_indices_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gather_elements_0_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gather_elements_0_dnnl.cc new file mode 100644 index 000000000..f58a8ac0b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gather_elements_0_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_0_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_0/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gather_elements_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_0_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gather_elements_1_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gather_elements_1_dnnl.cc new file mode 100644 index 000000000..eca5caad2 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gather_elements_1_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_1_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_1/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gather_elements_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_1_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gather_elements_negative_indices_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gather_elements_negative_indices_dnnl.cc new file mode 100644 index 000000000..f55102f06 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gather_elements_negative_indices_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_negative_indices_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_negative_indices/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gather_elements_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_negative_indices_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gather_negative_indices_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gather_negative_indices_dnnl.cc new file mode 100644 index 000000000..75b7e1a9c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gather_negative_indices_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_gather_negative_indices_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_negative_indices/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gather_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_negative_indices_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gathernd_example_float32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gathernd_example_float32_dnnl.cc new file mode 100644 index 000000000..396058c36 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gathernd_example_float32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_float32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_float32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gathernd_example_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_float32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gathernd_example_int32_batch_dim1_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gathernd_example_int32_batch_dim1_dnnl.cc new file mode 100644 index 000000000..ea7e17a56 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gathernd_example_int32_batch_dim1_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_int32_batch_dim1_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_int32_batch_dim1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gathernd_example_int32_batch_dim1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_int32_batch_dim1_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gathernd_example_int32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gathernd_example_int32_dnnl.cc new file mode 100644 index 000000000..aa9bf5035 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gathernd_example_int32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_int32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_int32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gathernd_example_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_int32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_all_attributes_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_all_attributes_dnnl.cc new file mode 100644 index 000000000..039a13b8b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_all_attributes_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_gemm_all_attributes_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_all_attributes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_all_attributes/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_all_attributes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_all_attributes_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_alpha_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_alpha_dnnl.cc new file mode 100644 index 000000000..11d663333 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_alpha_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_gemm_alpha_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_alpha/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_alpha/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_alpha | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_alpha_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_beta_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_beta_dnnl.cc new file mode 100644 index 000000000..f312785f8 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_beta_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_gemm_beta_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_beta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_beta/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_beta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_beta_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_default_matrix_bias_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_matrix_bias_dnnl.cc new file mode 100644 index 000000000..34d0faba6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_matrix_bias_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_matrix_bias_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_matrix_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_matrix_bias/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_default_matrix_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_matrix_bias_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_default_no_bias_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_no_bias_dnnl.cc new file mode 100644 index 000000000..0f93a5106 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_no_bias_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_gemm_default_no_bias_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_no_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_no_bias/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_default_no_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_no_bias_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_default_scalar_bias_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_scalar_bias_dnnl.cc new file mode 100644 index 000000000..0a89d0f86 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_scalar_bias_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_scalar_bias_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_scalar_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_scalar_bias/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_default_scalar_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_scalar_bias_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_default_single_elem_vector_bias_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_single_elem_vector_bias_dnnl.cc new file mode 100644 index 000000000..43fcebd23 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_single_elem_vector_bias_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_single_elem_vector_bias_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_single_elem_vector_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_default_single_elem_vector_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_single_elem_vector_bias_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_default_vector_bias_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_vector_bias_dnnl.cc new file mode 100644 index 000000000..01359a8f7 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_vector_bias_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_vector_bias_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_vector_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_vector_bias/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_default_vector_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_vector_bias_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_default_zero_bias_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_zero_bias_dnnl.cc new file mode 100644 index 000000000..fb5ffb886 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_default_zero_bias_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_zero_bias_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_zero_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_zero_bias/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_default_zero_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_zero_bias_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_transposeA_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_transposeA_dnnl.cc new file mode 100644 index 000000000..5f5ce0402 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_transposeA_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_gemm_transposeA_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_transposeA/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_transposeA/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_transposeA | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_transposeA_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_gemm_transposeB_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_gemm_transposeB_dnnl.cc new file mode 100644 index 000000000..86934d2aa --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_gemm_transposeB_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_gemm_transposeB_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_transposeB/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_transposeB/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_gemm_transposeB | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_transposeB_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_greater_equal_bcast_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_greater_equal_bcast_dnnl.cc new file mode 100644 index 000000000..1539598cc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_greater_equal_bcast_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_bcast_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_bcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_bcast/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_greater_equal_bcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_bcast_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_greater_equal_bcast_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_greater_equal_bcast_expanded_dnnl.cc new file mode 100644 index 000000000..1d9b72782 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_greater_equal_bcast_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_bcast_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_bcast_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_bcast_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_greater_equal_bcast_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_bcast_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_greater_equal_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_greater_equal_dnnl.cc new file mode 100644 index 000000000..905d57dd0 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_greater_equal_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_greater_equal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_greater_equal_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_greater_equal_expanded_dnnl.cc new file mode 100644 index 000000000..694cda742 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_greater_equal_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_greater_equal_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_hardmax_negative_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_hardmax_negative_axis_dnnl.cc new file mode 100644 index 000000000..23729ebf7 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_hardmax_negative_axis_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_hardmax_negative_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_hardmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_hardmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_hardmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_hardmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_hardmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_hardmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_hardmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_hardmax_negative_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_if_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_if_dnnl.cc new file mode 100644 index 000000000..518997af8 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_if_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_if_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_if/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_if/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_if/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_if/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_if/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_if/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_if | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_if_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_if_seq_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_if_seq_dnnl.cc new file mode 100644 index 000000000..c0b31595a --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_if_seq_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_if_seq_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_if_seq/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_if_seq/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_if_seq/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_if_seq/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_if_seq/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_if_seq/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_if_seq | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_if_seq_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_less_equal_bcast_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_less_equal_bcast_dnnl.cc new file mode 100644 index 000000000..8db40eb60 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_less_equal_bcast_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_bcast_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_bcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_bcast/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_less_equal_bcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_bcast_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_less_equal_bcast_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_less_equal_bcast_expanded_dnnl.cc new file mode 100644 index 000000000..e18c0114a --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_less_equal_bcast_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_bcast_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_bcast_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_bcast_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_less_equal_bcast_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_bcast_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_less_equal_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_less_equal_dnnl.cc new file mode 100644 index 000000000..b99e458a6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_less_equal_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_less_equal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_less_equal_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_less_equal_expanded_dnnl.cc new file mode 100644 index 000000000..6c4d26904 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_less_equal_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_less_equal_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_0_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_0_expanded_dnnl.cc new file mode 100644 index 000000000..e4ffd8464 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_0_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_0_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_0_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_0_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_logsoftmax_axis_0_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_0_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_1_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_1_expanded_dnnl.cc new file mode 100644 index 000000000..e1fd4e6bb --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_1_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_1_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_1_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_logsoftmax_axis_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_1_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_2_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_2_expanded_dnnl.cc new file mode 100644 index 000000000..c87e0937f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_axis_2_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_2_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_2_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_logsoftmax_axis_2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_2_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_default_axis_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_default_axis_expanded_dnnl.cc new file mode 100644 index 000000000..6d754ed90 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_default_axis_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_default_axis_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_default_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_default_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_logsoftmax_default_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_default_axis_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_example_1_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_example_1_expanded_dnnl.cc new file mode 100644 index 000000000..be8d205e4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_example_1_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_example_1_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_example_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_example_1_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_logsoftmax_example_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_example_1_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_large_number_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_large_number_expanded_dnnl.cc new file mode 100644 index 000000000..ff9419db9 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_large_number_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_large_number_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_large_number_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_large_number_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_logsoftmax_large_number_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_large_number_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_negative_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_negative_axis_dnnl.cc new file mode 100644 index 000000000..ad957f053 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_negative_axis_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_negative_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_logsoftmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_negative_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_negative_axis_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_negative_axis_expanded_dnnl.cc new file mode 100644 index 000000000..f1faa3230 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_logsoftmax_negative_axis_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_negative_axis_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_negative_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_logsoftmax_negative_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_negative_axis_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_loop11_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_loop11_dnnl.cc new file mode 100644 index 000000000..ae3d467b0 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_loop11_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_loop11_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_loop11/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_loop11/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_loop11 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_loop11_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_loop13_seq_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_loop13_seq_dnnl.cc new file mode 100644 index 000000000..39f6ca583 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_loop13_seq_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_loop13_seq_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_loop13_seq/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_loop13_seq/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_loop13_seq | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_loop13_seq_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_float16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_float16_dnnl.cc new file mode 100644 index 000000000..7f1b2646b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_float16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_float16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_float32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_float32_dnnl.cc new file mode 100644 index 000000000..4b37c512d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_float32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_float32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_float64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_float64_dnnl.cc new file mode 100644 index 000000000..f57753f49 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_float64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_float64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_int16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_int16_dnnl.cc new file mode 100644 index 000000000..0f9c537a3 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_int16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_int16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_int32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_int32_dnnl.cc new file mode 100644 index 000000000..09cbdbfab --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_int32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_int32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_int64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_int64_dnnl.cc new file mode 100644 index 000000000..8e3b9ff42 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_int64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_int64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_int8_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_int8_dnnl.cc new file mode 100644 index 000000000..2c6ad9642 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_int8_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_int8_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int8/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int8_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_uint16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_uint16_dnnl.cc new file mode 100644 index 000000000..cd081b111 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_uint16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_uint16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_uint32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_uint32_dnnl.cc new file mode 100644 index 000000000..a216beb60 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_uint32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_uint32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_uint64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_uint64_dnnl.cc new file mode 100644 index 000000000..455577144 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_uint64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_uint64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_max_uint8_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_max_uint8_dnnl.cc new file mode 100644 index 000000000..7be5a7e8f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_max_uint8_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_max_uint8_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint8/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_max_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint8_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_maxpool_2d_uint8_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_maxpool_2d_uint8_dnnl.cc new file mode 100644 index 000000000..17b0cb55d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_maxpool_2d_uint8_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_maxpool_2d_uint8_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_maxpool_2d_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_maxpool_2d_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_maxpool_2d_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_maxpool_2d_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_maxpool_2d_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_maxpool_2d_uint8/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_maxpool_2d_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_maxpool_2d_uint8_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_float16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_float16_dnnl.cc new file mode 100644 index 000000000..2a524c93f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_float16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_float16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_float32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_float32_dnnl.cc new file mode 100644 index 000000000..1ae36c0ee --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_float32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_float32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_float64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_float64_dnnl.cc new file mode 100644 index 000000000..c3337ff30 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_float64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_float64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_int16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_int16_dnnl.cc new file mode 100644 index 000000000..0612d0c47 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_int16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_int16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_int32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_int32_dnnl.cc new file mode 100644 index 000000000..72208590d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_int32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_int32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_int64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_int64_dnnl.cc new file mode 100644 index 000000000..5a8a2c48d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_int64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_int64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_int8_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_int8_dnnl.cc new file mode 100644 index 000000000..27b7aa999 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_int8_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_int8_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int8/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int8_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_uint16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_uint16_dnnl.cc new file mode 100644 index 000000000..a7263a555 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_uint16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_uint16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_uint32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_uint32_dnnl.cc new file mode 100644 index 000000000..3225b97d9 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_uint32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_uint32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_uint64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_uint64_dnnl.cc new file mode 100644 index 000000000..149f2d8a2 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_uint64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_uint64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_min_uint8_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_min_uint8_dnnl.cc new file mode 100644 index 000000000..85961b45a --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_min_uint8_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_min_uint8_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint8/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_min_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint8_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_broadcast_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_broadcast_dnnl.cc new file mode 100644 index 000000000..dfc5e41b3 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_broadcast_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_broadcast_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_broadcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_broadcast/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_broadcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_broadcast_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_int64_fmod_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_int64_fmod_dnnl.cc new file mode 100644 index 000000000..cc488f7a5 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_int64_fmod_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_int64_fmod_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_int64_fmod/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_int64_fmod/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_int64_fmod | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_int64_fmod_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float16_dnnl.cc new file mode 100644 index 000000000..e1121c2fc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_mixed_sign_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float32_dnnl.cc new file mode 100644 index 000000000..8408efadb --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_mixed_sign_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float64_dnnl.cc new file mode 100644 index 000000000..c71fcdb5c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_float64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_mixed_sign_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int16_dnnl.cc new file mode 100644 index 000000000..f0eb12640 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_mixed_sign_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int32_dnnl.cc new file mode 100644 index 000000000..9ce4cb0c2 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_mixed_sign_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int64_dnnl.cc new file mode 100644 index 000000000..05f09371a --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_mixed_sign_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int8_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int8_dnnl.cc new file mode 100644 index 000000000..5fe5a3aaf --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_mixed_sign_int8_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int8_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int8/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_mixed_sign_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int8_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_uint16_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_uint16_dnnl.cc new file mode 100644 index 000000000..1a298b889 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_uint16_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint16_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint16/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint16_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_uint32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_uint32_dnnl.cc new file mode 100644 index 000000000..355d32502 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_uint32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_uint64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_uint64_dnnl.cc new file mode 100644 index 000000000..7a2e74974 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_uint64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_mod_uint8_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_mod_uint8_dnnl.cc new file mode 100644 index 000000000..c94c7e1bd --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_mod_uint8_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint8_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint8/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_mod_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint8_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_momentum_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_momentum_dnnl.cc new file mode 100644 index 000000000..13d33b82e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_momentum_dnnl.cc @@ -0,0 +1,34 @@ +//===-test_momentum_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_momentum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_momentum/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_momentum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_momentum_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_momentum_multiple_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_momentum_multiple_dnnl.cc new file mode 100644 index 000000000..2d1d27c71 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_momentum_multiple_dnnl.cc @@ -0,0 +1,39 @@ +//===-test_momentum_multiple_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_momentum_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_momentum_multiple/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_momentum_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_momentum_multiple_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nesterov_momentum_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nesterov_momentum_dnnl.cc new file mode 100644 index 000000000..9673d49bc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nesterov_momentum_dnnl.cc @@ -0,0 +1,34 @@ +//===-test_nesterov_momentum_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nesterov_momentum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nesterov_momentum/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nesterov_momentum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nesterov_momentum_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NC_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NC_dnnl.cc new file mode 100644 index 000000000..b2b35dc7d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NC_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NC_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NC/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NC/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NC | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NC_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NC_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NC_expanded_dnnl.cc new file mode 100644 index 000000000..0236634b1 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NC_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NC_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NC_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NC_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NC_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NC_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_dnnl.cc new file mode 100644 index 000000000..1919a53a5 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_expanded_dnnl.cc new file mode 100644 index 000000000..dd6a25e34 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_ii_dnnl.cc new file mode 100644 index 000000000..bde5a3f31 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_ii_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_ii_expanded_dnnl.cc new file mode 100644 index 000000000..431e697ef --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_ii_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_mean_weight_negative_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_mean_weight_negative_ii_dnnl.cc new file mode 100644 index 000000000..1d8058575 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_mean_weight_negative_ii_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_mean_weight_negative_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_mean_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1_mean_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_mean_weight_negative_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_mean_weight_negative_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_mean_weight_negative_ii_expanded_dnnl.cc new file mode 100644 index 000000000..9d12127ee --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_mean_weight_negative_ii_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_mean_weight_negative_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_mean_weight_negative_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_dnnl.cc new file mode 100644 index 000000000..51db10a79 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_expanded_dnnl.cc new file mode 100644 index 000000000..9c4035f92 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_ii_dnnl.cc new file mode 100644 index 000000000..dd3c79152 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_ii_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_ii_expanded_dnnl.cc new file mode 100644 index 000000000..769195a8e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1_weight_ii_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_dnnl.cc new file mode 100644 index 000000000..10f71ef08 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_expanded_dnnl.cc new file mode 100644 index 000000000..aae76a03b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_dnnl.cc new file mode 100644 index 000000000..ec62807dc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_no_weight_reduction_mean_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_no_weight_reduction_mean_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_dnnl.cc new file mode 100644 index 000000000..43cd57408 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_mean_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_mean_dnnl.cc new file mode 100644 index 000000000..3e3a2e281 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_mean_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_mean_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_reduction_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_mean_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_mean_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_mean_expanded_dnnl.cc new file mode 100644 index 000000000..676533312 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_mean_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_mean_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_reduction_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_mean_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_sum_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_sum_dnnl.cc new file mode 100644 index 000000000..1f9a6d856 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_sum_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_sum_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_reduction_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_sum_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_sum_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_sum_expanded_dnnl.cc new file mode 100644 index 000000000..1708983e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_reduction_sum_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_sum_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_reduction_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_sum_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_dnnl.cc new file mode 100644 index 000000000..db21fff8b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_with_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_expanded_dnnl.cc new file mode 100644 index 000000000..cc3bd0523 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_with_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_mean_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_mean_dnnl.cc new file mode 100644 index 000000000..64ef91436 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_mean_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_mean_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_mean_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_dnnl.cc new file mode 100644 index 000000000..4924ba8f6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_dnnl.cc new file mode 100644 index 000000000..e5f7db095 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_dnnl.cc new file mode 100644 index 000000000..31449afc7 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_dnnl.cc new file mode 100644 index 000000000..db2d78bd6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_dnnl.cc new file mode 100644 index 000000000..a29ba38f8 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc new file mode 100644 index 000000000..f0f37a773 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc new file mode 100644 index 000000000..9283eaa26 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_sum_weight_high_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_sum_weight_high_ii_dnnl.cc new file mode 100644 index 000000000..9b9f2e2f6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_sum_weight_high_ii_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3_sum_weight_high_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_sum_weight_high_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc new file mode 100644 index 000000000..25c8ec169 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_mean_weight_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_mean_weight_dnnl.cc new file mode 100644 index 000000000..362a20551 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_mean_weight_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3d4d5_mean_weight_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_mean_weight_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc new file mode 100644 index 000000000..8e306aaff --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_none_no_weight_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_none_no_weight_dnnl.cc new file mode 100644 index 000000000..1bd5ac812 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_none_no_weight_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3d4d5_none_no_weight_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_none_no_weight_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc new file mode 100644 index 000000000..42c402f0f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_onehot_negative_indices_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_onehot_negative_indices_dnnl.cc new file mode 100644 index 000000000..13e1a37e0 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_onehot_negative_indices_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_onehot_negative_indices_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_onehot_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_onehot_negative_indices/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_onehot_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_onehot_negative_indices_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_onehot_with_negative_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_onehot_with_negative_axis_dnnl.cc new file mode 100644 index 000000000..c23a98124 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_onehot_with_negative_axis_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_onehot_with_negative_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_onehot_with_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_onehot_with_negative_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_onehot_with_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_onehot_with_negative_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_int32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_int32_dnnl.cc new file mode 100644 index 000000000..b43eede13 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_int32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_int32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_int32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_pow_types_float32_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_int32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_int64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_int64_dnnl.cc new file mode 100644 index 000000000..b617b7c4f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_int64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_int64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_int64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_pow_types_float32_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_int64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_uint32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_uint32_dnnl.cc new file mode 100644 index 000000000..43c3a581d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_uint32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_uint32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_uint32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_pow_types_float32_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_uint32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_uint64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_uint64_dnnl.cc new file mode 100644 index 000000000..12293e5cc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_pow_types_float32_uint64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_uint64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_uint64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_pow_types_float32_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_uint64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_pow_types_float_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_pow_types_float_dnnl.cc new file mode 100644 index 000000000..fed87970e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_pow_types_float_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_pow_types_float | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_pow_types_int32_float32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_pow_types_int32_float32_dnnl.cc new file mode 100644 index 000000000..d49ca4cf7 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_pow_types_int32_float32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int32_float32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int32_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int32_float32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_pow_types_int32_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int32_float32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_pow_types_int32_int32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_pow_types_int32_int32_dnnl.cc new file mode 100644 index 000000000..bcad81727 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_pow_types_int32_int32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int32_int32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int32_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int32_int32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_pow_types_int32_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int32_int32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_pow_types_int64_float32_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_pow_types_int64_float32_dnnl.cc new file mode 100644 index 000000000..9d64089db --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_pow_types_int64_float32_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int64_float32_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int64_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int64_float32/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_pow_types_int64_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int64_float32_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_pow_types_int64_int64_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_pow_types_int64_int64_dnnl.cc new file mode 100644 index 000000000..faa56e16f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_pow_types_int64_int64_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int64_int64_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int64_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int64_int64/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_pow_types_int64_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int64_int64_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_pow_types_int_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_pow_types_int_dnnl.cc new file mode 100644 index 000000000..fa2762493 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_pow_types_int_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_pow_types_int | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_quantizelinear_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_quantizelinear_axis_dnnl.cc new file mode 100644 index 000000000..1261bed1f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_quantizelinear_axis_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_quantizelinear_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_quantizelinear_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_quantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_quantizelinear_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_quantizelinear_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_range_float_type_positive_delta_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_range_float_type_positive_delta_dnnl.cc new file mode 100644 index 000000000..9af91a8e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_range_float_type_positive_delta_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_range_float_type_positive_delta_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_float_type_positive_delta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_float_type_positive_delta/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_range_float_type_positive_delta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_float_type_positive_delta_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_range_float_type_positive_delta_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_range_float_type_positive_delta_expanded_dnnl.cc new file mode 100644 index 000000000..2f64f73b8 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_range_float_type_positive_delta_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_range_float_type_positive_delta_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_float_type_positive_delta_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_float_type_positive_delta_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_range_float_type_positive_delta_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_float_type_positive_delta_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_range_int32_type_negative_delta_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_range_int32_type_negative_delta_dnnl.cc new file mode 100644 index 000000000..66f694298 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_range_int32_type_negative_delta_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_range_int32_type_negative_delta_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_int32_type_negative_delta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_int32_type_negative_delta/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_range_int32_type_negative_delta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_int32_type_negative_delta_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_range_int32_type_negative_delta_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_range_int32_type_negative_delta_expanded_dnnl.cc new file mode 100644 index 000000000..a8b9d0a4c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_range_int32_type_negative_delta_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_range_int32_type_negative_delta_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_int32_type_negative_delta_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_range_int32_type_negative_delta_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_int32_type_negative_delta_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_l1_negative_axes_keep_dims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_l1_negative_axes_keep_dims_example_dnnl.cc new file mode 100644 index 000000000..5aae802e9 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_l1_negative_axes_keep_dims_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l1_negative_axes_keep_dims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l1_negative_axes_keep_dims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_l1_negative_axes_keep_dims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l1_negative_axes_keep_dims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_l1_negative_axes_keep_dims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_l1_negative_axes_keep_dims_random_dnnl.cc new file mode 100644 index 000000000..7a131f5f4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_l1_negative_axes_keep_dims_random_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l1_negative_axes_keep_dims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l1_negative_axes_keep_dims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_l1_negative_axes_keep_dims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l1_negative_axes_keep_dims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_l2_negative_axes_keep_dims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_l2_negative_axes_keep_dims_example_dnnl.cc new file mode 100644 index 000000000..c34172c89 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_l2_negative_axes_keep_dims_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l2_negative_axes_keep_dims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l2_negative_axes_keep_dims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_l2_negative_axes_keep_dims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l2_negative_axes_keep_dims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_l2_negative_axes_keep_dims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_l2_negative_axes_keep_dims_random_dnnl.cc new file mode 100644 index 000000000..0634b76b7 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_l2_negative_axes_keep_dims_random_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l2_negative_axes_keep_dims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l2_negative_axes_keep_dims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_l2_negative_axes_keep_dims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l2_negative_axes_keep_dims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_exp_negative_axes_keepdims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_exp_negative_axes_keepdims_example_dnnl.cc new file mode 100644 index 000000000..cfa51e474 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_exp_negative_axes_keepdims_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_exp_negative_axes_keepdims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_exp_negative_axes_keepdims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_exp_negative_axes_keepdims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_exp_negative_axes_keepdims_random_dnnl.cc new file mode 100644 index 000000000..edf59b502 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_exp_negative_axes_keepdims_random_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_exp_negative_axes_keepdims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_exp_negative_axes_keepdims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_negative_axes_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_negative_axes_dnnl.cc new file mode 100644 index 000000000..71809f92b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_log_sum_negative_axes_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_negative_axes_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_negative_axes/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_log_sum_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_negative_axes_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_max_negative_axes_keepdims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_max_negative_axes_keepdims_example_dnnl.cc new file mode 100644 index 000000000..661efbe51 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_max_negative_axes_keepdims_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_max_negative_axes_keepdims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_max_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_max_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_max_negative_axes_keepdims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_max_negative_axes_keepdims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_max_negative_axes_keepdims_random_dnnl.cc new file mode 100644 index 000000000..56d3a432e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_max_negative_axes_keepdims_random_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_max_negative_axes_keepdims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_max_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_max_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_max_negative_axes_keepdims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_mean_negative_axes_keepdims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_mean_negative_axes_keepdims_example_dnnl.cc new file mode 100644 index 000000000..a830db822 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_mean_negative_axes_keepdims_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_mean_negative_axes_keepdims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_mean_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_mean_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_mean_negative_axes_keepdims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_mean_negative_axes_keepdims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_mean_negative_axes_keepdims_random_dnnl.cc new file mode 100644 index 000000000..084efc254 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_mean_negative_axes_keepdims_random_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_mean_negative_axes_keepdims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_mean_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_mean_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_mean_negative_axes_keepdims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_min_negative_axes_keepdims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_min_negative_axes_keepdims_example_dnnl.cc new file mode 100644 index 000000000..f937ab91c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_min_negative_axes_keepdims_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_min_negative_axes_keepdims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_min_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_min_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_min_negative_axes_keepdims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_min_negative_axes_keepdims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_min_negative_axes_keepdims_random_dnnl.cc new file mode 100644 index 000000000..64894fd19 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_min_negative_axes_keepdims_random_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_min_negative_axes_keepdims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_min_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_min_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_min_negative_axes_keepdims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_prod_negative_axes_keepdims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_prod_negative_axes_keepdims_example_dnnl.cc new file mode 100644 index 000000000..3add854fc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_prod_negative_axes_keepdims_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_prod_negative_axes_keepdims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_prod_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_prod_negative_axes_keepdims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_prod_negative_axes_keepdims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_prod_negative_axes_keepdims_random_dnnl.cc new file mode 100644 index 000000000..591feb9d1 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_prod_negative_axes_keepdims_random_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_prod_negative_axes_keepdims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_prod_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_prod_negative_axes_keepdims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_empty_axes_input_noop_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_empty_axes_input_noop_example_dnnl.cc new file mode 100644 index 000000000..89ec0a3dd --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_empty_axes_input_noop_example_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_empty_axes_input_noop_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_empty_axes_input_noop_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_sum_empty_axes_input_noop_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_empty_axes_input_noop_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_empty_axes_input_noop_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_empty_axes_input_noop_random_dnnl.cc new file mode 100644 index 000000000..62fbe89db --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_empty_axes_input_noop_random_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_empty_axes_input_noop_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_empty_axes_input_noop_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_sum_empty_axes_input_noop_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_empty_axes_input_noop_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_negative_axes_keepdims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_negative_axes_keepdims_example_dnnl.cc new file mode 100644 index 000000000..35492d01e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_negative_axes_keepdims_example_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_negative_axes_keepdims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_sum_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_negative_axes_keepdims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_negative_axes_keepdims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_negative_axes_keepdims_random_dnnl.cc new file mode 100644 index 000000000..e3e9f8843 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_negative_axes_keepdims_random_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_negative_axes_keepdims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_sum_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_negative_axes_keepdims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_square_negative_axes_keepdims_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_square_negative_axes_keepdims_example_dnnl.cc new file mode 100644 index 000000000..b67c3a904 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_square_negative_axes_keepdims_example_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_sum_square_negative_axes_keepdims_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_square_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_sum_square_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_square_negative_axes_keepdims_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_square_negative_axes_keepdims_random_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_square_negative_axes_keepdims_random_dnnl.cc new file mode 100644 index 000000000..9c09018c4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reduce_sum_square_negative_axes_keepdims_random_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_reduce_sum_square_negative_axes_keepdims_random_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_square_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reduce_sum_square_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_square_negative_axes_keepdims_random_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reshape_negative_extended_dims_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reshape_negative_extended_dims_dnnl.cc new file mode 100644 index 000000000..6933b527b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reshape_negative_extended_dims_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_reshape_negative_extended_dims_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_negative_extended_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_negative_extended_dims/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reshape_negative_extended_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_negative_extended_dims_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reshape_reordered_all_dims_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reshape_reordered_all_dims_dnnl.cc new file mode 100644 index 000000000..1a3c6f740 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reshape_reordered_all_dims_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_reshape_reordered_all_dims_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_reordered_all_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_reordered_all_dims/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reshape_reordered_all_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_reordered_all_dims_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reshape_reordered_last_dims_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reshape_reordered_last_dims_dnnl.cc new file mode 100644 index 000000000..c73fc7c1c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reshape_reordered_last_dims_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_reshape_reordered_last_dims_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_reordered_last_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_reordered_last_dims/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reshape_reordered_last_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_reordered_last_dims_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reshape_zero_and_negative_dim_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reshape_zero_and_negative_dim_dnnl.cc new file mode 100644 index 000000000..63a3334b2 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reshape_zero_and_negative_dim_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_reshape_zero_and_negative_dim_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_zero_and_negative_dim/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_zero_and_negative_dim/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reshape_zero_and_negative_dim | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_zero_and_negative_dim_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_reshape_zero_dim_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_reshape_zero_dim_dnnl.cc new file mode 100644 index 000000000..3a59add0f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_reshape_zero_dim_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_reshape_zero_dim_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_zero_dim/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_zero_dim/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_reshape_zero_dim | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_zero_dim_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc new file mode 100644 index 000000000..5cca47d9c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_align_corners_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_align_corners_dnnl.cc new file mode 100644 index 000000000..e23b24615 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_align_corners_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_align_corners_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_downsample_scales_cubic_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_align_corners_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_dnnl.cc new file mode 100644 index 000000000..c0fd72d6d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_cubic_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_downsample_scales_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_linear_align_corners_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_linear_align_corners_dnnl.cc new file mode 100644 index 000000000..5a0dd7452 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_linear_align_corners_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_linear_align_corners_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_linear_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_downsample_scales_linear_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_linear_align_corners_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_linear_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_linear_dnnl.cc new file mode 100644 index 000000000..b78ef44b9 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_linear_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_linear_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_linear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_linear/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_downsample_scales_linear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_linear_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_nearest_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_nearest_dnnl.cc new file mode 100644 index 000000000..cb94e2f3f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_scales_nearest_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_nearest_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_nearest/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_downsample_scales_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_nearest_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_cubic_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_cubic_dnnl.cc new file mode 100644 index 000000000..3e75d028e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_cubic_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_cubic_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_cubic/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_downsample_sizes_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_cubic_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_linear_pytorch_half_pixel_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_linear_pytorch_half_pixel_dnnl.cc new file mode 100644 index 000000000..f8ce2ffc7 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_linear_pytorch_half_pixel_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_linear_pytorch_half_pixel_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_linear_pytorch_half_pixel_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_nearest_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_nearest_dnnl.cc new file mode 100644 index 000000000..b5b14b84a --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_nearest_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_nearest_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_nearest/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_downsample_sizes_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_nearest_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_dnnl.cc new file mode 100644 index 000000000..97c815249 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_tf_crop_and_resize_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_tf_crop_and_resize_dnnl.cc new file mode 100644 index 000000000..380021530 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_tf_crop_and_resize_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_resize_tf_crop_and_resize_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_tf_crop_and_resize/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_tf_crop_and_resize/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_tf_crop_and_resize | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_tf_crop_and_resize_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc new file mode 100644 index 000000000..f0a93b665 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_align_corners_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_align_corners_dnnl.cc new file mode 100644 index 000000000..f8f246b55 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_align_corners_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_align_corners_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_scales_cubic_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_align_corners_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_asymmetric_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_asymmetric_dnnl.cc new file mode 100644 index 000000000..d90404728 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_asymmetric_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_asymmetric_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_asymmetric/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_scales_cubic_asymmetric | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_asymmetric_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_dnnl.cc new file mode 100644 index 000000000..bfade7af4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_cubic_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_scales_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_linear_align_corners_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_linear_align_corners_dnnl.cc new file mode 100644 index 000000000..0f857bb87 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_linear_align_corners_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_linear_align_corners_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_linear_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_scales_linear_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_linear_align_corners_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_linear_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_linear_dnnl.cc new file mode 100644 index 000000000..f3d14bce6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_linear_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_linear_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_linear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_linear/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_scales_linear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_linear_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_nearest_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_nearest_dnnl.cc new file mode 100644 index 000000000..651da3b44 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_scales_nearest_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_nearest_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_nearest/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_scales_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_nearest_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_cubic_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_cubic_dnnl.cc new file mode 100644 index 000000000..e3090d178 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_cubic_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_cubic_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_cubic/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_sizes_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_cubic_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_ceil_half_pixel_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_ceil_half_pixel_dnnl.cc new file mode 100644 index 000000000..d22ac2a34 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_ceil_half_pixel_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_ceil_half_pixel_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_ceil_half_pixel_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_dnnl.cc new file mode 100644 index 000000000..1c0e04e68 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_sizes_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_floor_align_corners_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_floor_align_corners_dnnl.cc new file mode 100644 index 000000000..ef9337020 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_floor_align_corners_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_floor_align_corners_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_sizes_nearest_floor_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_floor_align_corners_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_dnnl.cc new file mode 100644 index 000000000..f6d01f99e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_round_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_round_dnnl.cc new file mode 100644 index 000000000..41b49e679 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_round_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_round_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_round/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_round/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_round/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_round/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_round/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_round/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_round | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_round_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_scatter_elements_with_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_scatter_elements_with_axis_dnnl.cc new file mode 100644 index 000000000..0bddf2741 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_scatter_elements_with_axis_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_with_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_with_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_with_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_scatter_elements_with_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_with_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_scatter_elements_with_negative_indices_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_scatter_elements_with_negative_indices_dnnl.cc new file mode 100644 index 000000000..50871712e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_scatter_elements_with_negative_indices_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_with_negative_indices_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_with_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_with_negative_indices/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_scatter_elements_with_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_with_negative_indices_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_scatter_elements_without_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_scatter_elements_without_axis_dnnl.cc new file mode 100644 index 000000000..b657f2bad --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_scatter_elements_without_axis_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_without_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_without_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_scatter_elements_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_without_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_scatternd_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_scatternd_dnnl.cc new file mode 100644 index 000000000..99270d085 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_scatternd_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_scatternd_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatternd/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatternd/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_scatternd | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatternd_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_dnnl.cc new file mode 100644 index 000000000..5990ec282 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1_mean_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_expanded_dnnl.cc new file mode 100644 index 000000000..d817ca678 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_log_prob_dnnl.cc new file mode 100644 index 000000000..eed0edf88 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_log_prob_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..35186c46b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc new file mode 100644 index 000000000..e9047ae51 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc new file mode 100644 index 000000000..5a8f91540 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_dnnl.cc new file mode 100644 index 000000000..a4ee35dcc --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..7b147dd2b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_dnnl.cc new file mode 100644 index 000000000..a1b5a3ee6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3_sum_weight_high_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc new file mode 100644 index 000000000..c4314680f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_dnnl.cc new file mode 100644 index 000000000..d6ba89b6a --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..dc2dfdf5b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_dnnl.cc new file mode 100644 index 000000000..a32909eb9 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3d4d5_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc new file mode 100644 index 000000000..e28d32637 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_dnnl.cc new file mode 100644 index 000000000..fb7c57818 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..7159553e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_dnnl.cc new file mode 100644 index 000000000..4fbe5aed6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3d4d5_none_no_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc new file mode 100644 index 000000000..88b1ed034 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_dnnl.cc new file mode 100644 index 000000000..e0ab7eb70 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..4fd40f69b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_dnnl.cc new file mode 100644 index 000000000..970f25653 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_3d_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_expanded_dnnl.cc new file mode 100644 index 000000000..aa40856b3 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_3d_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_log_prob_dnnl.cc new file mode 100644 index 000000000..a37fa657f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_log_prob_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_3d_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..a681c0f0c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_3d_log_prob_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_3d_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_dnnl.cc new file mode 100644 index 000000000..c4223a03e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_expanded_dnnl.cc new file mode 100644 index 000000000..7ae0053df --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_log_prob_dnnl.cc new file mode 100644 index 000000000..d4f7f3890 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_log_prob_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..78977bf19 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_log_prob_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_dnnl.cc new file mode 100644 index 000000000..f3681e6a7 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_3d_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_expanded_dnnl.cc new file mode 100644 index 000000000..47f83050b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_3d_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_log_prob_dnnl.cc new file mode 100644 index 000000000..5e736043c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_log_prob_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_3d_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..3f9a0011a --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_3d_log_prob_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_3d_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_dnnl.cc new file mode 100644 index 000000000..68c86947d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_4d_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_4d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_expanded_dnnl.cc new file mode 100644 index 000000000..d42e75736 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_4d_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_4d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_log_prob_dnnl.cc new file mode 100644 index 000000000..f2373c288 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_log_prob_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_4d_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_4d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..4487fa957 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_4d_log_prob_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_4d_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_dnnl.cc new file mode 100644 index 000000000..b670b8c3b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_expanded_dnnl.cc new file mode 100644 index 000000000..c546f9282 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_log_prob_dnnl.cc new file mode 100644 index 000000000..932ef4822 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_log_prob_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..91669cb6b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_no_weight_ii_log_prob_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_no_weight_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_dnnl.cc new file mode 100644 index 000000000..e1c930ee1 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_expanded_dnnl.cc new file mode 100644 index 000000000..0277b60ae --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_dnnl.cc new file mode 100644 index 000000000..4e3b4755b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_3d_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_expanded_dnnl.cc new file mode 100644 index 000000000..90dcc11c4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_3d_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_log_prob_dnnl.cc new file mode 100644 index 000000000..1091aa689 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_log_prob_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_3d_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..724842dad --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_3d_log_prob_expanded_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_3d_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_dnnl.cc new file mode 100644 index 000000000..bc338cf40 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_4d_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_4d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_expanded_dnnl.cc new file mode 100644 index 000000000..b19587335 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_4d_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_4d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_log_prob_dnnl.cc new file mode 100644 index 000000000..821a7ee51 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_log_prob_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_4d_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_4d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..73933afda --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_4d_log_prob_expanded_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_4d_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_dnnl.cc new file mode 100644 index 000000000..1b2a40873 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_expanded_dnnl.cc new file mode 100644 index 000000000..306f5ca66 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_log_prob_dnnl.cc new file mode 100644 index 000000000..d20fc3fa0 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_log_prob_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..045a33f31 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_ii_log_prob_expanded_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_log_prob_dnnl.cc new file mode 100644 index 000000000..636b02e52 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_log_prob_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..85d301dde --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_mean_weight_log_prob_expanded_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_mean_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_none_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_none_dnnl.cc new file mode 100644 index 000000000..6ae196abd --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_none_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_none_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_none | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_none_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_none_expanded_dnnl.cc new file mode 100644 index 000000000..048412685 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_none_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_none_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_none_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_none_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_none_log_prob_dnnl.cc new file mode 100644 index 000000000..3027fdaad --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_none_log_prob_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_none_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_none_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_none_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..5bac027f5 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_none_log_prob_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_none_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_dnnl.cc new file mode 100644 index 000000000..e3235bd56 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_weights_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_none_weights | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_expanded_dnnl.cc new file mode 100644 index 000000000..586239465 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_weights_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_none_weights_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_log_prob_dnnl.cc new file mode 100644 index 000000000..e4234baa4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_log_prob_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_none_weights_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_none_weights_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..aacb9e71d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_none_weights_log_prob_expanded_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_sce_none_weights_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_none_weights_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_sum_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_sum_dnnl.cc new file mode 100644 index 000000000..e446a8663 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_sum_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_sum_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_sum_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_sum_expanded_dnnl.cc new file mode 100644 index 000000000..d71bf433f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_sum_expanded_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sce_sum_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_sum_log_prob_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_sum_log_prob_dnnl.cc new file mode 100644 index 000000000..7a7512c76 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_sum_log_prob_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_sum_log_prob_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_log_prob/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_sum_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_log_prob_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sce_sum_log_prob_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sce_sum_log_prob_expanded_dnnl.cc new file mode 100644 index 000000000..860dab272 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sce_sum_log_prob_expanded_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sce_sum_log_prob_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sce_sum_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_log_prob_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sequence_insert_at_back_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sequence_insert_at_back_dnnl.cc new file mode 100644 index 000000000..185bad582 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sequence_insert_at_back_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_sequence_insert_at_back_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sequence_insert_at_back/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sequence_insert_at_back/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sequence_insert_at_back | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sequence_insert_at_back_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_sequence_insert_at_front_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_sequence_insert_at_front_dnnl.cc new file mode 100644 index 000000000..e7f1dfdfa --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_sequence_insert_at_front_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_sequence_insert_at_front_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sequence_insert_at_front/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sequence_insert_at_front/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_sequence_insert_at_front | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sequence_insert_at_front_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_slice_negative_axes_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_slice_negative_axes_dnnl.cc new file mode 100644 index 000000000..9bd6f2bcf --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_slice_negative_axes_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_slice_negative_axes_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_slice_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_slice_negative_axes/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_slice_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_slice_negative_axes_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_softmax_axis_0_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_softmax_axis_0_expanded_dnnl.cc new file mode 100644 index 000000000..80c0c49e3 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_softmax_axis_0_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_0_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_0_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_0_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_0_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_0_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_0_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_0_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_softmax_axis_0_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_0_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_softmax_axis_1_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_softmax_axis_1_expanded_dnnl.cc new file mode 100644 index 000000000..c1814529c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_softmax_axis_1_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_1_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_1_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_softmax_axis_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_1_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_softmax_axis_2_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_softmax_axis_2_expanded_dnnl.cc new file mode 100644 index 000000000..154845ab4 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_softmax_axis_2_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_2_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_2_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_softmax_axis_2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_2_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_softmax_default_axis_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_softmax_default_axis_expanded_dnnl.cc new file mode 100644 index 000000000..51b6bea2c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_softmax_default_axis_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_softmax_default_axis_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_default_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_default_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_default_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_default_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_default_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_default_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_softmax_default_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_default_axis_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_softmax_example_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_softmax_example_expanded_dnnl.cc new file mode 100644 index 000000000..da1b1d881 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_softmax_example_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_softmax_example_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_example_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_example_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_example_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_example_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_example_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_example_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_softmax_example_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_example_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_softmax_large_number_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_softmax_large_number_expanded_dnnl.cc new file mode 100644 index 000000000..75dd2a22d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_softmax_large_number_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_softmax_large_number_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_large_number_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_large_number_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_large_number_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_large_number_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_large_number_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_large_number_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_softmax_large_number_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_large_number_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_softmax_negative_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_softmax_negative_axis_dnnl.cc new file mode 100644 index 000000000..255958f8a --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_softmax_negative_axis_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_softmax_negative_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_softmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_negative_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_softmax_negative_axis_expanded_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_softmax_negative_axis_expanded_dnnl.cc new file mode 100644 index 000000000..4a0d1150a --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_softmax_negative_axis_expanded_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_softmax_negative_axis_expanded_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_negative_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_negative_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_softmax_negative_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_negative_axis_expanded_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_split_zero_size_splits_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_split_zero_size_splits_dnnl.cc new file mode 100644 index 000000000..fbfced7b6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_split_zero_size_splits_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_split_zero_size_splits_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_split_zero_size_splits/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_split_zero_size_splits/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_split_zero_size_splits | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_split_zero_size_splits_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_squeeze_negative_axes_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_squeeze_negative_axes_dnnl.cc new file mode 100644 index 000000000..67dd11fde --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_squeeze_negative_axes_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_squeeze_negative_axes_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_squeeze_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_squeeze_negative_axes/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_squeeze_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_squeeze_negative_axes_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_top_k_negative_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_top_k_negative_axis_dnnl.cc new file mode 100644 index 000000000..0a74a9d85 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_top_k_negative_axis_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_top_k_negative_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_top_k_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_top_k_negative_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_top_k_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_top_k_negative_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_top_k_smallest_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_top_k_smallest_dnnl.cc new file mode 100644 index 000000000..844d808aa --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_top_k_smallest_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_top_k_smallest_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_top_k_smallest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_top_k_smallest/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_top_k_smallest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_top_k_smallest_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_training_dropout_default_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_default_dnnl.cc new file mode 100644 index 000000000..f755bed9d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_default_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_default_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_default/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_default/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_training_dropout_default | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_default_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_training_dropout_default_mask_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_default_mask_dnnl.cc new file mode 100644 index 000000000..b0cbeb61a --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_default_mask_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_default_mask_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_default_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_default_mask/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_training_dropout_default_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_default_mask_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_training_dropout_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_dnnl.cc new file mode 100644 index 000000000..78587944b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_training_dropout | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_training_dropout_mask_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_mask_dnnl.cc new file mode 100644 index 000000000..4060468c8 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_mask_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_mask_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_mask/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_training_dropout_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_mask_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_training_dropout_zero_ratio_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_zero_ratio_dnnl.cc new file mode 100644 index 000000000..f2a35563f --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_zero_ratio_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_zero_ratio_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_zero_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_zero_ratio/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_training_dropout_zero_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_zero_ratio_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_training_dropout_zero_ratio_mask_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_zero_ratio_mask_dnnl.cc new file mode 100644 index 000000000..e3dd2da8d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_training_dropout_zero_ratio_mask_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_zero_ratio_mask_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_zero_ratio_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_zero_ratio_mask/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_training_dropout_zero_ratio_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_zero_ratio_mask_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unique_not_sorted_without_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unique_not_sorted_without_axis_dnnl.cc new file mode 100644 index 000000000..8bf69e57d --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unique_not_sorted_without_axis_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_unique_not_sorted_without_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_not_sorted_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_not_sorted_without_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unique_not_sorted_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_not_sorted_without_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_axis_3d_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_axis_3d_dnnl.cc new file mode 100644 index 000000000..1e79dfe48 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_axis_3d_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_axis_3d_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_axis_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_axis_3d/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unique_sorted_with_axis_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_axis_3d_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_axis_dnnl.cc new file mode 100644 index 000000000..300fff08c --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_axis_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unique_sorted_with_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_negative_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_negative_axis_dnnl.cc new file mode 100644 index 000000000..e869e9999 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_with_negative_axis_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_negative_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_negative_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unique_sorted_with_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_negative_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_without_axis_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_without_axis_dnnl.cc new file mode 100644 index 000000000..ae94950cd --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unique_sorted_without_axis_dnnl.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_without_axis_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_without_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unique_sorted_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_without_axis_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_0_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_0_dnnl.cc new file mode 100644 index 000000000..4dd441594 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_0_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_0_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_0/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unsqueeze_axis_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_0_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_1_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_1_dnnl.cc new file mode 100644 index 000000000..e61893f08 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_1_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_1_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_1/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unsqueeze_axis_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_1_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_2_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_2_dnnl.cc new file mode 100644 index 000000000..5bd880895 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_2_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_2_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_2/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unsqueeze_axis_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_2_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_3_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_3_dnnl.cc new file mode 100644 index 000000000..13a933399 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_axis_3_dnnl.cc @@ -0,0 +1,29 @@ +//===-test_unsqueeze_axis_3_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_3/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unsqueeze_axis_3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_3_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_negative_axes_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_negative_axes_dnnl.cc new file mode 100644 index 000000000..8b88edae6 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_negative_axes_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_negative_axes_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_negative_axes/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unsqueeze_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_negative_axes_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_three_axes_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_three_axes_dnnl.cc new file mode 100644 index 000000000..1205e404e --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_three_axes_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_three_axes_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_three_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_three_axes/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unsqueeze_three_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_three_axes_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_two_axes_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_two_axes_dnnl.cc new file mode 100644 index 000000000..0fd69565b --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_two_axes_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_two_axes_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_two_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_two_axes/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unsqueeze_two_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_two_axes_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_unsorted_axes_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_unsorted_axes_dnnl.cc new file mode 100644 index 000000000..97e15e986 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_unsqueeze_unsorted_axes_dnnl.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_unsorted_axes_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_unsorted_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_unsorted_axes/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_unsqueeze_unsorted_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_unsorted_axes_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_dnnl/test_where_long_example_dnnl.cc b/tests/unittests/lit_cases/test_dnnl/test_where_long_example_dnnl.cc new file mode 100644 index 000000000..6730ea832 --- /dev/null +++ b/tests/unittests/lit_cases/test_dnnl/test_where_long_example_dnnl.cc @@ -0,0 +1,31 @@ +//===-test_where_long_example_dnnl.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on dnnl +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_where_long_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_where_long_example/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations +// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_where_long_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_where_long_example_dnnl.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_adagrad_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_adagrad_eigen.cc new file mode 100644 index 000000000..84659461b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_adagrad_eigen.cc @@ -0,0 +1,34 @@ +//===-test_adagrad_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adagrad/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adagrad/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_adagrad | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adagrad_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_adagrad_multiple_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_adagrad_multiple_eigen.cc new file mode 100644 index 000000000..f5df08701 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_adagrad_multiple_eigen.cc @@ -0,0 +1,39 @@ +//===-test_adagrad_multiple_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adagrad_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adagrad_multiple/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_adagrad_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adagrad_multiple_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_adam_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_adam_eigen.cc new file mode 100644 index 000000000..c33903685 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_adam_eigen.cc @@ -0,0 +1,36 @@ +//===-test_adam_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adam/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adam/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_adam | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adam_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_adam_multiple_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_adam_multiple_eigen.cc new file mode 100644 index 000000000..22069d4e3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_adam_multiple_eigen.cc @@ -0,0 +1,43 @@ +//===-test_adam_multiple_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_4.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_8.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_8.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_9.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_9.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_5.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_5.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adam_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adam_multiple/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_adam_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adam_multiple_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmax_default_axis_example_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmax_default_axis_example_select_last_index_eigen.cc new file mode 100644 index 000000000..afb20520a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmax_default_axis_example_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmax_default_axis_example_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_default_axis_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmax_default_axis_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_default_axis_example_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmax_default_axis_random_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmax_default_axis_random_select_last_index_eigen.cc new file mode 100644 index 000000000..517c95223 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmax_default_axis_random_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmax_default_axis_random_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_default_axis_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmax_default_axis_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_default_axis_random_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmax_keepdims_example_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmax_keepdims_example_select_last_index_eigen.cc new file mode 100644 index 000000000..d2a44808a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmax_keepdims_example_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmax_keepdims_example_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmax_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_keepdims_example_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmax_keepdims_random_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmax_keepdims_random_select_last_index_eigen.cc new file mode 100644 index 000000000..cb4608013 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmax_keepdims_random_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmax_keepdims_random_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmax_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_keepdims_random_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_example_eigen.cc new file mode 100644 index 000000000..ab4aeba16 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmax_negative_axis_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_example_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_example_select_last_index_eigen.cc new file mode 100644 index 000000000..26a994e58 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_example_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_example_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmax_negative_axis_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_example_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_random_eigen.cc new file mode 100644 index 000000000..a4a9f6d0d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_random_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmax_negative_axis_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_random_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_random_select_last_index_eigen.cc new file mode 100644 index 000000000..f34cf9743 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmax_negative_axis_keepdims_random_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_random_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmax_negative_axis_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_random_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmax_no_keepdims_example_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmax_no_keepdims_example_select_last_index_eigen.cc new file mode 100644 index 000000000..f87f20b16 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmax_no_keepdims_example_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmax_no_keepdims_example_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_no_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmax_no_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_no_keepdims_example_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmax_no_keepdims_random_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmax_no_keepdims_random_select_last_index_eigen.cc new file mode 100644 index 000000000..90593c794 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmax_no_keepdims_random_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmax_no_keepdims_random_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_no_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmax_no_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_no_keepdims_random_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmin_default_axis_example_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmin_default_axis_example_select_last_index_eigen.cc new file mode 100644 index 000000000..858186827 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmin_default_axis_example_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmin_default_axis_example_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_default_axis_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmin_default_axis_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_default_axis_example_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmin_default_axis_random_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmin_default_axis_random_select_last_index_eigen.cc new file mode 100644 index 000000000..4e21c1c2a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmin_default_axis_random_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmin_default_axis_random_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_default_axis_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmin_default_axis_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_default_axis_random_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmin_keepdims_example_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmin_keepdims_example_select_last_index_eigen.cc new file mode 100644 index 000000000..e1172a0e7 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmin_keepdims_example_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmin_keepdims_example_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmin_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_keepdims_example_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmin_keepdims_random_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmin_keepdims_random_select_last_index_eigen.cc new file mode 100644 index 000000000..f332ee888 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmin_keepdims_random_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmin_keepdims_random_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmin_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_keepdims_random_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_example_eigen.cc new file mode 100644 index 000000000..3d00ebfbb --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmin_negative_axis_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_example_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_example_select_last_index_eigen.cc new file mode 100644 index 000000000..6e26a2bde --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_example_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_example_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmin_negative_axis_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_example_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_random_eigen.cc new file mode 100644 index 000000000..d0a07538e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_random_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmin_negative_axis_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_random_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_random_select_last_index_eigen.cc new file mode 100644 index 000000000..ba0c30fcd --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmin_negative_axis_keepdims_random_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_random_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmin_negative_axis_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_random_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmin_no_keepdims_example_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmin_no_keepdims_example_select_last_index_eigen.cc new file mode 100644 index 000000000..cd2f64056 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmin_no_keepdims_example_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmin_no_keepdims_example_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_no_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmin_no_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_no_keepdims_example_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_argmin_no_keepdims_random_select_last_index_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_argmin_no_keepdims_random_select_last_index_eigen.cc new file mode 100644 index 000000000..1659517d6 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_argmin_no_keepdims_random_select_last_index_eigen.cc @@ -0,0 +1,29 @@ +//===-test_argmin_no_keepdims_random_select_last_index_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_no_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_argmin_no_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_no_keepdims_random_select_last_index_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint16_eigen.cc new file mode 100644 index 000000000..cbc44a3fe --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_bitshift_left_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint32_eigen.cc new file mode 100644 index 000000000..e0b963711 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_bitshift_left_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint64_eigen.cc new file mode 100644 index 000000000..41d5c8b41 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_bitshift_left_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint8_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint8_eigen.cc new file mode 100644 index 000000000..65038b6eb --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_bitshift_left_uint8_eigen.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint8_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint8/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_bitshift_left_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint8_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint16_eigen.cc new file mode 100644 index 000000000..4798be5be --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_bitshift_right_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint32_eigen.cc new file mode 100644 index 000000000..0f5836c2f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_bitshift_right_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint64_eigen.cc new file mode 100644 index 000000000..0b47e6c9b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_bitshift_right_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint8_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint8_eigen.cc new file mode 100644 index 000000000..7d2f37207 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_bitshift_right_uint8_eigen.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint8_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint8/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_bitshift_right_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint8_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_cast_BFLOAT16_to_FLOAT_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_cast_BFLOAT16_to_FLOAT_eigen.cc new file mode 100644 index 000000000..505fcf840 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_cast_BFLOAT16_to_FLOAT_eigen.cc @@ -0,0 +1,29 @@ +//===-test_cast_BFLOAT16_to_FLOAT_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cast_BFLOAT16_to_FLOAT/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_cast_BFLOAT16_to_FLOAT | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cast_BFLOAT16_to_FLOAT_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_cast_FLOAT_to_BFLOAT16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_cast_FLOAT_to_BFLOAT16_eigen.cc new file mode 100644 index 000000000..bd9832efa --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_cast_FLOAT_to_BFLOAT16_eigen.cc @@ -0,0 +1,29 @@ +//===-test_cast_FLOAT_to_BFLOAT16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cast_FLOAT_to_BFLOAT16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_cast_FLOAT_to_BFLOAT16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cast_FLOAT_to_BFLOAT16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_celu_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_celu_eigen.cc new file mode 100644 index 000000000..327232e5c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_celu_eigen.cc @@ -0,0 +1,29 @@ +//===-test_celu_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_celu/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_celu/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_celu/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_celu/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_celu/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_celu/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_celu | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_celu_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_celu_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_celu_expanded_eigen.cc new file mode 100644 index 000000000..b2a310852 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_celu_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_celu_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_celu_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_celu_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_celu_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_celu_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_celu_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_celu_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_celu_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_celu_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_clip_default_int8_inbounds_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_clip_default_int8_inbounds_eigen.cc new file mode 100644 index 000000000..8e5d1c02f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_clip_default_int8_inbounds_eigen.cc @@ -0,0 +1,29 @@ +//===-test_clip_default_int8_inbounds_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_inbounds/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_inbounds/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_inbounds/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_inbounds/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_inbounds/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_inbounds/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_clip_default_int8_inbounds | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_inbounds_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_clip_default_int8_max_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_clip_default_int8_max_eigen.cc new file mode 100644 index 000000000..03e69ae05 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_clip_default_int8_max_eigen.cc @@ -0,0 +1,30 @@ +//===-test_clip_default_int8_max_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_max/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_max/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_clip_default_int8_max | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_max_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_clip_default_int8_min_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_clip_default_int8_min_eigen.cc new file mode 100644 index 000000000..1ce376b98 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_clip_default_int8_min_eigen.cc @@ -0,0 +1,30 @@ +//===-test_clip_default_int8_min_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_min/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_min/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_clip_default_int8_min | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_min_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_compress_negative_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_compress_negative_axis_eigen.cc new file mode 100644 index 000000000..02cb881f5 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_compress_negative_axis_eigen.cc @@ -0,0 +1,30 @@ +//===-test_compress_negative_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_compress_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_compress_negative_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_compress_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_compress_negative_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_concat_1d_axis_negative_1_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_concat_1d_axis_negative_1_eigen.cc new file mode 100644 index 000000000..4a611bb88 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_concat_1d_axis_negative_1_eigen.cc @@ -0,0 +1,30 @@ +//===-test_concat_1d_axis_negative_1_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_1d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_1d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_concat_1d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_1d_axis_negative_1_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_concat_2d_axis_negative_1_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_concat_2d_axis_negative_1_eigen.cc new file mode 100644 index 000000000..eb79a816e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_concat_2d_axis_negative_1_eigen.cc @@ -0,0 +1,30 @@ +//===-test_concat_2d_axis_negative_1_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_2d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_2d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_concat_2d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_2d_axis_negative_1_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_concat_2d_axis_negative_2_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_concat_2d_axis_negative_2_eigen.cc new file mode 100644 index 000000000..ba93a48e3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_concat_2d_axis_negative_2_eigen.cc @@ -0,0 +1,30 @@ +//===-test_concat_2d_axis_negative_2_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_2d_axis_negative_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_2d_axis_negative_2/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_concat_2d_axis_negative_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_2d_axis_negative_2_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_1_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_1_eigen.cc new file mode 100644 index 000000000..9162762d8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_1_eigen.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_1_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_concat_3d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_1_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_2_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_2_eigen.cc new file mode 100644 index 000000000..c28a2db5f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_2_eigen.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_2_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_2/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_concat_3d_axis_negative_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_2_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_3_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_3_eigen.cc new file mode 100644 index 000000000..0a4b1be4e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_concat_3d_axis_negative_3_eigen.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_3_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_3/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_concat_3d_axis_negative_3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_3_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_constantofshape_int_shape_zero_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_constantofshape_int_shape_zero_eigen.cc new file mode 100644 index 000000000..609cd8c9f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_constantofshape_int_shape_zero_eigen.cc @@ -0,0 +1,29 @@ +//===-test_constantofshape_int_shape_zero_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_constantofshape_int_shape_zero/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_constantofshape_int_shape_zero/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_constantofshape_int_shape_zero/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_constantofshape_int_shape_zero/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_constantofshape_int_shape_zero/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_constantofshape_int_shape_zero/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_constantofshape_int_shape_zero | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_constantofshape_int_shape_zero_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_eigen.cc new file mode 100644 index 000000000..d99e1297b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_eigen.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_cumsum_1d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_exclusive_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_exclusive_eigen.cc new file mode 100644 index 000000000..93a602b0b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_exclusive_eigen.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_exclusive_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_exclusive/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_exclusive/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_cumsum_1d_exclusive | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_exclusive_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_reverse_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_reverse_eigen.cc new file mode 100644 index 000000000..9d9ecb2cf --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_reverse_eigen.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_reverse_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_reverse/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_reverse/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_cumsum_1d_reverse | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_reverse_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_reverse_exclusive_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_reverse_exclusive_eigen.cc new file mode 100644 index 000000000..2aca1eef8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_cumsum_1d_reverse_exclusive_eigen.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_reverse_exclusive_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_reverse_exclusive/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_cumsum_1d_reverse_exclusive | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_reverse_exclusive_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_cumsum_2d_axis_0_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_cumsum_2d_axis_0_eigen.cc new file mode 100644 index 000000000..57c5d876f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_cumsum_2d_axis_0_eigen.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_axis_0_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_axis_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_axis_0/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_cumsum_2d_axis_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_axis_0_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_cumsum_2d_axis_1_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_cumsum_2d_axis_1_eigen.cc new file mode 100644 index 000000000..df5ff7e61 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_cumsum_2d_axis_1_eigen.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_axis_1_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_axis_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_axis_1/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_cumsum_2d_axis_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_axis_1_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_cumsum_2d_negative_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_cumsum_2d_negative_axis_eigen.cc new file mode 100644 index 000000000..f2f7b5e48 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_cumsum_2d_negative_axis_eigen.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_negative_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_negative_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_cumsum_2d_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_negative_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_depthtospace_crd_mode_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_depthtospace_crd_mode_eigen.cc new file mode 100644 index 000000000..8a9d3dceb --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_depthtospace_crd_mode_eigen.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_crd_mode_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_crd_mode/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_crd_mode/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_depthtospace_crd_mode | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_crd_mode_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_depthtospace_crd_mode_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_depthtospace_crd_mode_example_eigen.cc new file mode 100644 index 000000000..378e2d777 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_depthtospace_crd_mode_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_crd_mode_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_crd_mode_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_crd_mode_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_depthtospace_crd_mode_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_crd_mode_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_depthtospace_dcr_mode_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_depthtospace_dcr_mode_eigen.cc new file mode 100644 index 000000000..0f4f4730f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_depthtospace_dcr_mode_eigen.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_dcr_mode_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_dcr_mode/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_dcr_mode/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_dcr_mode/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_dcr_mode/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_dcr_mode/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_dcr_mode/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_depthtospace_dcr_mode | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_dcr_mode_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dequantizelinear_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dequantizelinear_axis_eigen.cc new file mode 100644 index 000000000..48c472f11 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dequantizelinear_axis_eigen.cc @@ -0,0 +1,31 @@ +//===-test_dequantizelinear_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dequantizelinear_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dequantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dequantizelinear_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dequantizelinear_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_det_2d_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_det_2d_eigen.cc new file mode 100644 index 000000000..2070def77 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_det_2d_eigen.cc @@ -0,0 +1,29 @@ +//===-test_det_2d_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_det_2d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_det_2d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_det_2d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_det_2d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_det_2d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_det_2d/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_det_2d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_det_2d_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_det_nd_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_det_nd_eigen.cc new file mode 100644 index 000000000..8639765a6 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_det_nd_eigen.cc @@ -0,0 +1,29 @@ +//===-test_det_nd_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_det_nd/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_det_nd/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_det_nd/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_det_nd/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_det_nd/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_det_nd/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_det_nd | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_det_nd_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dropout_default_mask_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dropout_default_mask_eigen.cc new file mode 100644 index 000000000..d30dcf095 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dropout_default_mask_eigen.cc @@ -0,0 +1,30 @@ +//===-test_dropout_default_mask_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_mask/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dropout_default_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_mask_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dropout_default_mask_ratio_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dropout_default_mask_ratio_eigen.cc new file mode 100644 index 000000000..f8bf92eae --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dropout_default_mask_ratio_eigen.cc @@ -0,0 +1,31 @@ +//===-test_dropout_default_mask_ratio_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_mask_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_mask_ratio/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dropout_default_mask_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_mask_ratio_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dropout_default_old_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dropout_default_old_eigen.cc new file mode 100644 index 000000000..74df13a3a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dropout_default_old_eigen.cc @@ -0,0 +1,29 @@ +//===-test_dropout_default_old_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_old/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_old/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_old/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_old/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_old/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_old/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dropout_default_old | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_old_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dropout_default_ratio_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dropout_default_ratio_eigen.cc new file mode 100644 index 000000000..21a330c69 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dropout_default_ratio_eigen.cc @@ -0,0 +1,30 @@ +//===-test_dropout_default_ratio_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_ratio/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dropout_default_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_ratio_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dropout_random_old_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dropout_random_old_eigen.cc new file mode 100644 index 000000000..9c1a80b2e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dropout_random_old_eigen.cc @@ -0,0 +1,29 @@ +//===-test_dropout_random_old_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_random_old/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_random_old/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_random_old/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_random_old/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_random_old/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_random_old/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dropout_random_old | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_random_old_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_eigen.cc new file mode 100644 index 000000000..47b7e79aa --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_eigen.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dynamicquantizelinear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_expanded_eigen.cc new file mode 100644 index 000000000..3c09b43da --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dynamicquantizelinear_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_max_adjusted_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_max_adjusted_eigen.cc new file mode 100644 index 000000000..b16adf886 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_max_adjusted_eigen.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_max_adjusted_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_max_adjusted/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dynamicquantizelinear_max_adjusted | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_max_adjusted_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_max_adjusted_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_max_adjusted_expanded_eigen.cc new file mode 100644 index 000000000..1a811e788 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_max_adjusted_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_max_adjusted_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_max_adjusted_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dynamicquantizelinear_max_adjusted_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_max_adjusted_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_min_adjusted_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_min_adjusted_eigen.cc new file mode 100644 index 000000000..7b1340920 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_min_adjusted_eigen.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_min_adjusted_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_min_adjusted/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dynamicquantizelinear_min_adjusted | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_min_adjusted_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_min_adjusted_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_min_adjusted_expanded_eigen.cc new file mode 100644 index 000000000..93f528f58 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_dynamicquantizelinear_min_adjusted_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_min_adjusted_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_min_adjusted_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_dynamicquantizelinear_min_adjusted_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_min_adjusted_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_einsum_batch_diagonal_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_einsum_batch_diagonal_eigen.cc new file mode 100644 index 000000000..4839f7cc3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_einsum_batch_diagonal_eigen.cc @@ -0,0 +1,29 @@ +//===-test_einsum_batch_diagonal_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_diagonal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_diagonal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_diagonal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_diagonal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_batch_diagonal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_batch_diagonal/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_einsum_batch_diagonal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_batch_diagonal_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_einsum_batch_matmul_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_einsum_batch_matmul_eigen.cc new file mode 100644 index 000000000..d33c48a42 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_einsum_batch_matmul_eigen.cc @@ -0,0 +1,30 @@ +//===-test_einsum_batch_matmul_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_batch_matmul/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_batch_matmul/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_einsum_batch_matmul | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_batch_matmul_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_einsum_inner_prod_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_einsum_inner_prod_eigen.cc new file mode 100644 index 000000000..6c14fa704 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_einsum_inner_prod_eigen.cc @@ -0,0 +1,30 @@ +//===-test_einsum_inner_prod_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_inner_prod/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_inner_prod/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_einsum_inner_prod | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_inner_prod_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_einsum_sum_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_einsum_sum_eigen.cc new file mode 100644 index 000000000..b86fe6d82 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_einsum_sum_eigen.cc @@ -0,0 +1,29 @@ +//===-test_einsum_sum_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_sum/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_einsum_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_sum_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_einsum_transpose_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_einsum_transpose_eigen.cc new file mode 100644 index 000000000..dc94112e7 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_einsum_transpose_eigen.cc @@ -0,0 +1,29 @@ +//===-test_einsum_transpose_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_transpose/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_transpose/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_transpose/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_transpose/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_transpose/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_transpose/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_einsum_transpose | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_transpose_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis1_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis1_eigen.cc new file mode 100644 index 000000000..31f27586f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis1_eigen.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis1_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis1/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_flatten_negative_axis1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis1_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis2_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis2_eigen.cc new file mode 100644 index 000000000..19a8cf5fa --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis2_eigen.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis2_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis2/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_flatten_negative_axis2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis2_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis3_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis3_eigen.cc new file mode 100644 index 000000000..534bddad7 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis3_eigen.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis3_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis3/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_flatten_negative_axis3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis3_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis4_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis4_eigen.cc new file mode 100644 index 000000000..53d363923 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_flatten_negative_axis4_eigen.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis4_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis4/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis4/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis4/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis4/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis4/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis4/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_flatten_negative_axis4 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis4_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gather_2d_indices_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gather_2d_indices_eigen.cc new file mode 100644 index 000000000..5cbdc51a5 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gather_2d_indices_eigen.cc @@ -0,0 +1,30 @@ +//===-test_gather_2d_indices_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_2d_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_2d_indices/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gather_2d_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_2d_indices_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gather_elements_0_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gather_elements_0_eigen.cc new file mode 100644 index 000000000..365852bfa --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gather_elements_0_eigen.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_0_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_0/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gather_elements_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_0_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gather_elements_1_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gather_elements_1_eigen.cc new file mode 100644 index 000000000..f1d77d20b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gather_elements_1_eigen.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_1_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_1/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gather_elements_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_1_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gather_elements_negative_indices_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gather_elements_negative_indices_eigen.cc new file mode 100644 index 000000000..530e18379 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gather_elements_negative_indices_eigen.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_negative_indices_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_negative_indices/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gather_elements_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_negative_indices_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gather_negative_indices_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gather_negative_indices_eigen.cc new file mode 100644 index 000000000..7e6a7c243 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gather_negative_indices_eigen.cc @@ -0,0 +1,30 @@ +//===-test_gather_negative_indices_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_negative_indices/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gather_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_negative_indices_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gathernd_example_float32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gathernd_example_float32_eigen.cc new file mode 100644 index 000000000..9d736fade --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gathernd_example_float32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_float32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_float32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gathernd_example_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_float32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gathernd_example_int32_batch_dim1_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gathernd_example_int32_batch_dim1_eigen.cc new file mode 100644 index 000000000..2109a2e32 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gathernd_example_int32_batch_dim1_eigen.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_int32_batch_dim1_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_int32_batch_dim1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gathernd_example_int32_batch_dim1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_int32_batch_dim1_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gathernd_example_int32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gathernd_example_int32_eigen.cc new file mode 100644 index 000000000..2c35ab434 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gathernd_example_int32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_int32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_int32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gathernd_example_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_int32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_all_attributes_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_all_attributes_eigen.cc new file mode 100644 index 000000000..b8e60669e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_all_attributes_eigen.cc @@ -0,0 +1,31 @@ +//===-test_gemm_all_attributes_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_all_attributes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_all_attributes/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_all_attributes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_all_attributes_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_alpha_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_alpha_eigen.cc new file mode 100644 index 000000000..e4eaa6dae --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_alpha_eigen.cc @@ -0,0 +1,31 @@ +//===-test_gemm_alpha_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_alpha/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_alpha/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_alpha | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_alpha_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_beta_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_beta_eigen.cc new file mode 100644 index 000000000..e267a2290 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_beta_eigen.cc @@ -0,0 +1,31 @@ +//===-test_gemm_beta_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_beta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_beta/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_beta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_beta_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_default_matrix_bias_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_default_matrix_bias_eigen.cc new file mode 100644 index 000000000..eab33df9a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_default_matrix_bias_eigen.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_matrix_bias_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_matrix_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_matrix_bias/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_default_matrix_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_matrix_bias_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_default_no_bias_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_default_no_bias_eigen.cc new file mode 100644 index 000000000..f87775eaf --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_default_no_bias_eigen.cc @@ -0,0 +1,30 @@ +//===-test_gemm_default_no_bias_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_no_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_no_bias/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_default_no_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_no_bias_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_default_scalar_bias_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_default_scalar_bias_eigen.cc new file mode 100644 index 000000000..5ea53eef7 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_default_scalar_bias_eigen.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_scalar_bias_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_scalar_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_scalar_bias/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_default_scalar_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_scalar_bias_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_default_single_elem_vector_bias_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_default_single_elem_vector_bias_eigen.cc new file mode 100644 index 000000000..2955cd0ae --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_default_single_elem_vector_bias_eigen.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_single_elem_vector_bias_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_single_elem_vector_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_default_single_elem_vector_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_single_elem_vector_bias_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_default_vector_bias_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_default_vector_bias_eigen.cc new file mode 100644 index 000000000..037e1a6d8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_default_vector_bias_eigen.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_vector_bias_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_vector_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_vector_bias/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_default_vector_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_vector_bias_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_default_zero_bias_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_default_zero_bias_eigen.cc new file mode 100644 index 000000000..d65794887 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_default_zero_bias_eigen.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_zero_bias_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_zero_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_zero_bias/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_default_zero_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_zero_bias_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_transposeA_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_transposeA_eigen.cc new file mode 100644 index 000000000..0da964c2c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_transposeA_eigen.cc @@ -0,0 +1,31 @@ +//===-test_gemm_transposeA_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_transposeA/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_transposeA/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_transposeA | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_transposeA_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_gemm_transposeB_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_gemm_transposeB_eigen.cc new file mode 100644 index 000000000..20e1ddb7b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_gemm_transposeB_eigen.cc @@ -0,0 +1,31 @@ +//===-test_gemm_transposeB_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_transposeB/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_transposeB/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_gemm_transposeB | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_transposeB_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_greater_equal_bcast_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_greater_equal_bcast_eigen.cc new file mode 100644 index 000000000..0551c4fee --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_greater_equal_bcast_eigen.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_bcast_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_bcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_bcast/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_greater_equal_bcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_bcast_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_greater_equal_bcast_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_greater_equal_bcast_expanded_eigen.cc new file mode 100644 index 000000000..c5ce1270f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_greater_equal_bcast_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_bcast_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_bcast_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_bcast_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_greater_equal_bcast_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_bcast_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_greater_equal_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_greater_equal_eigen.cc new file mode 100644 index 000000000..d9b62230d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_greater_equal_eigen.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_greater_equal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_greater_equal_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_greater_equal_expanded_eigen.cc new file mode 100644 index 000000000..d0e241724 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_greater_equal_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_greater_equal_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_hardmax_negative_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_hardmax_negative_axis_eigen.cc new file mode 100644 index 000000000..8417f36ca --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_hardmax_negative_axis_eigen.cc @@ -0,0 +1,29 @@ +//===-test_hardmax_negative_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_hardmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_hardmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_hardmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_hardmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_hardmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_hardmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_hardmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_hardmax_negative_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_if_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_if_eigen.cc new file mode 100644 index 000000000..8659e23c1 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_if_eigen.cc @@ -0,0 +1,29 @@ +//===-test_if_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_if/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_if/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_if/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_if/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_if/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_if/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_if | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_if_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_if_seq_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_if_seq_eigen.cc new file mode 100644 index 000000000..72311a1d7 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_if_seq_eigen.cc @@ -0,0 +1,29 @@ +//===-test_if_seq_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_if_seq/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_if_seq/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_if_seq/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_if_seq/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_if_seq/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_if_seq/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_if_seq | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_if_seq_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_less_equal_bcast_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_less_equal_bcast_eigen.cc new file mode 100644 index 000000000..988a1bdf3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_less_equal_bcast_eigen.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_bcast_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_bcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_bcast/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_less_equal_bcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_bcast_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_less_equal_bcast_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_less_equal_bcast_expanded_eigen.cc new file mode 100644 index 000000000..b02229e61 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_less_equal_bcast_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_bcast_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_bcast_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_bcast_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_less_equal_bcast_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_bcast_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_less_equal_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_less_equal_eigen.cc new file mode 100644 index 000000000..a05048606 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_less_equal_eigen.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_less_equal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_less_equal_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_less_equal_expanded_eigen.cc new file mode 100644 index 000000000..ca80c67d3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_less_equal_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_less_equal_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_0_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_0_expanded_eigen.cc new file mode 100644 index 000000000..32cb59ef8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_0_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_0_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_0_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_0_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_logsoftmax_axis_0_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_0_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_1_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_1_expanded_eigen.cc new file mode 100644 index 000000000..016b98500 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_1_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_1_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_1_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_logsoftmax_axis_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_1_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_2_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_2_expanded_eigen.cc new file mode 100644 index 000000000..eddd62a83 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_axis_2_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_2_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_2_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_logsoftmax_axis_2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_2_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_logsoftmax_default_axis_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_default_axis_expanded_eigen.cc new file mode 100644 index 000000000..436d11162 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_default_axis_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_default_axis_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_default_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_default_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_logsoftmax_default_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_default_axis_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_logsoftmax_example_1_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_example_1_expanded_eigen.cc new file mode 100644 index 000000000..1800549d1 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_example_1_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_example_1_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_example_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_example_1_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_logsoftmax_example_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_example_1_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_logsoftmax_large_number_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_large_number_expanded_eigen.cc new file mode 100644 index 000000000..85ecfcea3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_large_number_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_large_number_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_large_number_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_large_number_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_logsoftmax_large_number_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_large_number_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_logsoftmax_negative_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_negative_axis_eigen.cc new file mode 100644 index 000000000..b43c450db --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_negative_axis_eigen.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_negative_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_logsoftmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_negative_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_logsoftmax_negative_axis_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_negative_axis_expanded_eigen.cc new file mode 100644 index 000000000..f7aa69c99 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_logsoftmax_negative_axis_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_negative_axis_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_negative_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_logsoftmax_negative_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_negative_axis_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_loop11_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_loop11_eigen.cc new file mode 100644 index 000000000..2c836f736 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_loop11_eigen.cc @@ -0,0 +1,32 @@ +//===-test_loop11_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_loop11/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_loop11/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_loop11 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_loop11_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_loop13_seq_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_loop13_seq_eigen.cc new file mode 100644 index 000000000..4497feb50 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_loop13_seq_eigen.cc @@ -0,0 +1,31 @@ +//===-test_loop13_seq_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_loop13_seq/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_loop13_seq/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_loop13_seq | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_loop13_seq_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_float16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_float16_eigen.cc new file mode 100644 index 000000000..0fcedb7c3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_float16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_float16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_float32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_float32_eigen.cc new file mode 100644 index 000000000..65a34bb97 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_float32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_float32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_float64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_float64_eigen.cc new file mode 100644 index 000000000..d420c9a2e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_float64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_float64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_int16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_int16_eigen.cc new file mode 100644 index 000000000..ea4e5b14d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_int16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_int16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_int32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_int32_eigen.cc new file mode 100644 index 000000000..e4cff21dd --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_int32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_int32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_int64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_int64_eigen.cc new file mode 100644 index 000000000..1cc5d7021 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_int64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_int64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_int8_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_int8_eigen.cc new file mode 100644 index 000000000..bf7cb0b4b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_int8_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_int8_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int8/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int8_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_uint16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_uint16_eigen.cc new file mode 100644 index 000000000..9a1f0a1f6 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_uint16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_uint16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_uint32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_uint32_eigen.cc new file mode 100644 index 000000000..5dfe2e8b2 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_uint32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_uint32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_uint64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_uint64_eigen.cc new file mode 100644 index 000000000..77d4daff8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_uint64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_uint64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_max_uint8_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_max_uint8_eigen.cc new file mode 100644 index 000000000..1c701d4b0 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_max_uint8_eigen.cc @@ -0,0 +1,30 @@ +//===-test_max_uint8_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint8/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_max_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint8_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_maxpool_2d_uint8_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_maxpool_2d_uint8_eigen.cc new file mode 100644 index 000000000..d1a7e80ff --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_maxpool_2d_uint8_eigen.cc @@ -0,0 +1,29 @@ +//===-test_maxpool_2d_uint8_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_maxpool_2d_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_maxpool_2d_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_maxpool_2d_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_maxpool_2d_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_maxpool_2d_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_maxpool_2d_uint8/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_maxpool_2d_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_maxpool_2d_uint8_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_float16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_float16_eigen.cc new file mode 100644 index 000000000..77a734a6a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_float16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_float16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_float32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_float32_eigen.cc new file mode 100644 index 000000000..c830e843e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_float32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_float32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_float64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_float64_eigen.cc new file mode 100644 index 000000000..0c4ec7b54 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_float64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_float64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_int16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_int16_eigen.cc new file mode 100644 index 000000000..a999a15e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_int16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_int16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_int32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_int32_eigen.cc new file mode 100644 index 000000000..1523af2f6 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_int32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_int32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_int64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_int64_eigen.cc new file mode 100644 index 000000000..eb77666a2 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_int64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_int64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_int8_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_int8_eigen.cc new file mode 100644 index 000000000..458149b68 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_int8_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_int8_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int8/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int8_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_uint16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_uint16_eigen.cc new file mode 100644 index 000000000..55c3ce4e0 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_uint16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_uint16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_uint32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_uint32_eigen.cc new file mode 100644 index 000000000..e539affd4 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_uint32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_uint32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_uint64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_uint64_eigen.cc new file mode 100644 index 000000000..e7136cb94 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_uint64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_uint64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_min_uint8_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_min_uint8_eigen.cc new file mode 100644 index 000000000..21570605c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_min_uint8_eigen.cc @@ -0,0 +1,30 @@ +//===-test_min_uint8_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint8/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_min_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint8_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_broadcast_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_broadcast_eigen.cc new file mode 100644 index 000000000..373d3524e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_broadcast_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_broadcast_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_broadcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_broadcast/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_broadcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_broadcast_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_int64_fmod_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_int64_fmod_eigen.cc new file mode 100644 index 000000000..4806a5f37 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_int64_fmod_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_int64_fmod_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_int64_fmod/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_int64_fmod/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_int64_fmod | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_int64_fmod_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float16_eigen.cc new file mode 100644 index 000000000..111b212cd --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_mixed_sign_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float32_eigen.cc new file mode 100644 index 000000000..c355e3ad9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_mixed_sign_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float64_eigen.cc new file mode 100644 index 000000000..a41339288 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_float64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_mixed_sign_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int16_eigen.cc new file mode 100644 index 000000000..47f04d729 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_mixed_sign_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int32_eigen.cc new file mode 100644 index 000000000..ca1d5a7b3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_mixed_sign_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int64_eigen.cc new file mode 100644 index 000000000..ef0aebd37 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_mixed_sign_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int8_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int8_eigen.cc new file mode 100644 index 000000000..5bf865213 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_mixed_sign_int8_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int8_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int8/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_mixed_sign_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int8_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_uint16_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_uint16_eigen.cc new file mode 100644 index 000000000..4dde6be7f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_uint16_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint16_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint16/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint16_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_uint32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_uint32_eigen.cc new file mode 100644 index 000000000..dd8a757de --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_uint32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_uint64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_uint64_eigen.cc new file mode 100644 index 000000000..8e31e82e0 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_uint64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_mod_uint8_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_mod_uint8_eigen.cc new file mode 100644 index 000000000..898228751 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_mod_uint8_eigen.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint8_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint8/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_mod_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint8_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_momentum_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_momentum_eigen.cc new file mode 100644 index 000000000..79b2dc7cf --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_momentum_eigen.cc @@ -0,0 +1,34 @@ +//===-test_momentum_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_momentum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_momentum/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_momentum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_momentum_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_momentum_multiple_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_momentum_multiple_eigen.cc new file mode 100644 index 000000000..0c4738f21 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_momentum_multiple_eigen.cc @@ -0,0 +1,39 @@ +//===-test_momentum_multiple_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_momentum_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_momentum_multiple/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_momentum_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_momentum_multiple_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nesterov_momentum_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nesterov_momentum_eigen.cc new file mode 100644 index 000000000..dff73de58 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nesterov_momentum_eigen.cc @@ -0,0 +1,34 @@ +//===-test_nesterov_momentum_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nesterov_momentum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nesterov_momentum/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nesterov_momentum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nesterov_momentum_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NC_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NC_eigen.cc new file mode 100644 index 000000000..77e6a36ed --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NC_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NC_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NC/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NC/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NC | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NC_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NC_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NC_expanded_eigen.cc new file mode 100644 index 000000000..603eb2ad5 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NC_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NC_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NC_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NC_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NC_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NC_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_eigen.cc new file mode 100644 index 000000000..050ab5cc5 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_expanded_eigen.cc new file mode 100644 index 000000000..16940a332 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_ii_eigen.cc new file mode 100644 index 000000000..99a00c8a4 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_ii_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_ii_expanded_eigen.cc new file mode 100644 index 000000000..3c1e2b75f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_ii_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_mean_weight_negative_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_mean_weight_negative_ii_eigen.cc new file mode 100644 index 000000000..a6bf2d54d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_mean_weight_negative_ii_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_mean_weight_negative_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_mean_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1_mean_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_mean_weight_negative_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_mean_weight_negative_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_mean_weight_negative_ii_expanded_eigen.cc new file mode 100644 index 000000000..ec5d770ff --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_mean_weight_negative_ii_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_mean_weight_negative_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_mean_weight_negative_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_eigen.cc new file mode 100644 index 000000000..4b153369d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_expanded_eigen.cc new file mode 100644 index 000000000..59050f825 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_ii_eigen.cc new file mode 100644 index 000000000..874610109 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_ii_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_ii_expanded_eigen.cc new file mode 100644 index 000000000..63ba3aae5 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1_weight_ii_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_eigen.cc new file mode 100644 index 000000000..75c319800 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_expanded_eigen.cc new file mode 100644 index 000000000..6051a2101 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_eigen.cc new file mode 100644 index 000000000..36d21e0e4 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_no_weight_reduction_mean_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_no_weight_reduction_mean_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_eigen.cc new file mode 100644 index 000000000..afd1f05a7 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_mean_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_mean_eigen.cc new file mode 100644 index 000000000..2fb8dd4c4 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_mean_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_mean_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_reduction_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_mean_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_mean_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_mean_expanded_eigen.cc new file mode 100644 index 000000000..a6d5b9658 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_mean_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_mean_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_reduction_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_mean_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_sum_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_sum_eigen.cc new file mode 100644 index 000000000..98e9c087b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_sum_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_sum_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_reduction_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_sum_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_sum_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_sum_expanded_eigen.cc new file mode 100644 index 000000000..102883802 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_reduction_sum_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_sum_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_reduction_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_sum_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_eigen.cc new file mode 100644 index 000000000..4573c4468 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_with_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_expanded_eigen.cc new file mode 100644 index 000000000..a62350715 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_with_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_mean_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_mean_eigen.cc new file mode 100644 index 000000000..9c076a12c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_mean_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_mean_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_mean_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_eigen.cc new file mode 100644 index 000000000..c544a27e8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_eigen.cc new file mode 100644 index 000000000..41333b813 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_eigen.cc new file mode 100644 index 000000000..46fb1a8bb --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_eigen.cc new file mode 100644 index 000000000..fce0feda9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_eigen.cc new file mode 100644 index 000000000..5e53661ae --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_eigen.cc new file mode 100644 index 000000000..45e3dfa3a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3_none_no_weight_negative_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_none_no_weight_negative_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc new file mode 100644 index 000000000..ee72b640e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_sum_weight_high_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_sum_weight_high_ii_eigen.cc new file mode 100644 index 000000000..9ac3a43b6 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_sum_weight_high_ii_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3_sum_weight_high_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_sum_weight_high_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc new file mode 100644 index 000000000..9498ca510 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_mean_weight_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_mean_weight_eigen.cc new file mode 100644 index 000000000..b8e98410d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_mean_weight_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3d4d5_mean_weight_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_mean_weight_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc new file mode 100644 index 000000000..c77728e16 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_none_no_weight_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_none_no_weight_eigen.cc new file mode 100644 index 000000000..8f37ef89d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_none_no_weight_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3d4d5_none_no_weight_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_none_no_weight_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc new file mode 100644 index 000000000..22457a97b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_onehot_negative_indices_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_onehot_negative_indices_eigen.cc new file mode 100644 index 000000000..e5c9653a3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_onehot_negative_indices_eigen.cc @@ -0,0 +1,31 @@ +//===-test_onehot_negative_indices_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_onehot_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_onehot_negative_indices/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_onehot_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_onehot_negative_indices_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_onehot_with_negative_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_onehot_with_negative_axis_eigen.cc new file mode 100644 index 000000000..eab22a9e4 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_onehot_with_negative_axis_eigen.cc @@ -0,0 +1,31 @@ +//===-test_onehot_with_negative_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_onehot_with_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_onehot_with_negative_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_onehot_with_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_onehot_with_negative_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_int32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_int32_eigen.cc new file mode 100644 index 000000000..f1ca34893 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_int32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_int32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_int32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_pow_types_float32_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_int32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_int64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_int64_eigen.cc new file mode 100644 index 000000000..c2dd81ce7 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_int64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_int64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_int64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_pow_types_float32_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_int64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_uint32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_uint32_eigen.cc new file mode 100644 index 000000000..8499fcbdc --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_uint32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_uint32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_uint32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_pow_types_float32_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_uint32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_uint64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_uint64_eigen.cc new file mode 100644 index 000000000..023b65d11 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_pow_types_float32_uint64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_uint64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_uint64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_pow_types_float32_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_uint64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_pow_types_float_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_pow_types_float_eigen.cc new file mode 100644 index 000000000..df6b78f8d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_pow_types_float_eigen.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_pow_types_float | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_pow_types_int32_float32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_pow_types_int32_float32_eigen.cc new file mode 100644 index 000000000..5a7b10d3b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_pow_types_int32_float32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int32_float32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int32_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int32_float32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_pow_types_int32_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int32_float32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_pow_types_int32_int32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_pow_types_int32_int32_eigen.cc new file mode 100644 index 000000000..cb5c71bb5 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_pow_types_int32_int32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int32_int32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int32_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int32_int32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_pow_types_int32_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int32_int32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_pow_types_int64_float32_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_pow_types_int64_float32_eigen.cc new file mode 100644 index 000000000..bb0083796 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_pow_types_int64_float32_eigen.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int64_float32_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int64_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int64_float32/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_pow_types_int64_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int64_float32_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_pow_types_int64_int64_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_pow_types_int64_int64_eigen.cc new file mode 100644 index 000000000..e86469383 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_pow_types_int64_int64_eigen.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int64_int64_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int64_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int64_int64/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_pow_types_int64_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int64_int64_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_pow_types_int_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_pow_types_int_eigen.cc new file mode 100644 index 000000000..c61d971cd --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_pow_types_int_eigen.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_pow_types_int | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_quantizelinear_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_quantizelinear_axis_eigen.cc new file mode 100644 index 000000000..bd5dd9a4c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_quantizelinear_axis_eigen.cc @@ -0,0 +1,31 @@ +//===-test_quantizelinear_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_quantizelinear_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_quantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_quantizelinear_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_quantizelinear_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_range_float_type_positive_delta_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_range_float_type_positive_delta_eigen.cc new file mode 100644 index 000000000..e7d688710 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_range_float_type_positive_delta_eigen.cc @@ -0,0 +1,31 @@ +//===-test_range_float_type_positive_delta_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_float_type_positive_delta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_float_type_positive_delta/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_range_float_type_positive_delta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_float_type_positive_delta_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_range_float_type_positive_delta_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_range_float_type_positive_delta_expanded_eigen.cc new file mode 100644 index 000000000..5659023de --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_range_float_type_positive_delta_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_range_float_type_positive_delta_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_float_type_positive_delta_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_float_type_positive_delta_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_range_float_type_positive_delta_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_float_type_positive_delta_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_range_int32_type_negative_delta_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_range_int32_type_negative_delta_eigen.cc new file mode 100644 index 000000000..f7a501bb0 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_range_int32_type_negative_delta_eigen.cc @@ -0,0 +1,31 @@ +//===-test_range_int32_type_negative_delta_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_int32_type_negative_delta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_int32_type_negative_delta/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_range_int32_type_negative_delta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_int32_type_negative_delta_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_range_int32_type_negative_delta_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_range_int32_type_negative_delta_expanded_eigen.cc new file mode 100644 index 000000000..8e706cccb --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_range_int32_type_negative_delta_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_range_int32_type_negative_delta_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_int32_type_negative_delta_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_range_int32_type_negative_delta_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_int32_type_negative_delta_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_l1_negative_axes_keep_dims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_l1_negative_axes_keep_dims_example_eigen.cc new file mode 100644 index 000000000..d62a80753 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_l1_negative_axes_keep_dims_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l1_negative_axes_keep_dims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l1_negative_axes_keep_dims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_l1_negative_axes_keep_dims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l1_negative_axes_keep_dims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_l1_negative_axes_keep_dims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_l1_negative_axes_keep_dims_random_eigen.cc new file mode 100644 index 000000000..a5f427b7d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_l1_negative_axes_keep_dims_random_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l1_negative_axes_keep_dims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l1_negative_axes_keep_dims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_l1_negative_axes_keep_dims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l1_negative_axes_keep_dims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_l2_negative_axes_keep_dims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_l2_negative_axes_keep_dims_example_eigen.cc new file mode 100644 index 000000000..f9fb8d2af --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_l2_negative_axes_keep_dims_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l2_negative_axes_keep_dims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l2_negative_axes_keep_dims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_l2_negative_axes_keep_dims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l2_negative_axes_keep_dims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_l2_negative_axes_keep_dims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_l2_negative_axes_keep_dims_random_eigen.cc new file mode 100644 index 000000000..f45d5756e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_l2_negative_axes_keep_dims_random_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l2_negative_axes_keep_dims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l2_negative_axes_keep_dims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_l2_negative_axes_keep_dims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l2_negative_axes_keep_dims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_exp_negative_axes_keepdims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_exp_negative_axes_keepdims_example_eigen.cc new file mode 100644 index 000000000..45af7991d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_exp_negative_axes_keepdims_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_exp_negative_axes_keepdims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_exp_negative_axes_keepdims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_exp_negative_axes_keepdims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_exp_negative_axes_keepdims_random_eigen.cc new file mode 100644 index 000000000..49be5f618 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_exp_negative_axes_keepdims_random_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_exp_negative_axes_keepdims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_exp_negative_axes_keepdims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_negative_axes_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_negative_axes_eigen.cc new file mode 100644 index 000000000..42ebacba9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_log_sum_negative_axes_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_negative_axes_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_negative_axes/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_log_sum_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_negative_axes_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_max_negative_axes_keepdims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_max_negative_axes_keepdims_example_eigen.cc new file mode 100644 index 000000000..aca0cc980 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_max_negative_axes_keepdims_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_max_negative_axes_keepdims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_max_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_max_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_max_negative_axes_keepdims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_max_negative_axes_keepdims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_max_negative_axes_keepdims_random_eigen.cc new file mode 100644 index 000000000..3f21fb945 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_max_negative_axes_keepdims_random_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_max_negative_axes_keepdims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_max_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_max_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_max_negative_axes_keepdims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_mean_negative_axes_keepdims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_mean_negative_axes_keepdims_example_eigen.cc new file mode 100644 index 000000000..14290c3fd --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_mean_negative_axes_keepdims_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_mean_negative_axes_keepdims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_mean_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_mean_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_mean_negative_axes_keepdims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_mean_negative_axes_keepdims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_mean_negative_axes_keepdims_random_eigen.cc new file mode 100644 index 000000000..89b0ef6ed --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_mean_negative_axes_keepdims_random_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_mean_negative_axes_keepdims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_mean_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_mean_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_mean_negative_axes_keepdims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_min_negative_axes_keepdims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_min_negative_axes_keepdims_example_eigen.cc new file mode 100644 index 000000000..a74ee7197 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_min_negative_axes_keepdims_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_min_negative_axes_keepdims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_min_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_min_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_min_negative_axes_keepdims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_min_negative_axes_keepdims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_min_negative_axes_keepdims_random_eigen.cc new file mode 100644 index 000000000..aa6651837 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_min_negative_axes_keepdims_random_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_min_negative_axes_keepdims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_min_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_min_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_min_negative_axes_keepdims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_prod_negative_axes_keepdims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_prod_negative_axes_keepdims_example_eigen.cc new file mode 100644 index 000000000..a92b0438d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_prod_negative_axes_keepdims_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_prod_negative_axes_keepdims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_prod_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_prod_negative_axes_keepdims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_prod_negative_axes_keepdims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_prod_negative_axes_keepdims_random_eigen.cc new file mode 100644 index 000000000..9b65b0fcc --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_prod_negative_axes_keepdims_random_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_prod_negative_axes_keepdims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_prod_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_prod_negative_axes_keepdims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_sum_empty_axes_input_noop_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_empty_axes_input_noop_example_eigen.cc new file mode 100644 index 000000000..b6c5a9508 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_empty_axes_input_noop_example_eigen.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_empty_axes_input_noop_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_empty_axes_input_noop_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_sum_empty_axes_input_noop_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_empty_axes_input_noop_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_sum_empty_axes_input_noop_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_empty_axes_input_noop_random_eigen.cc new file mode 100644 index 000000000..39ea5e492 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_empty_axes_input_noop_random_eigen.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_empty_axes_input_noop_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_empty_axes_input_noop_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_sum_empty_axes_input_noop_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_empty_axes_input_noop_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_sum_negative_axes_keepdims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_negative_axes_keepdims_example_eigen.cc new file mode 100644 index 000000000..f8a0f3a95 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_negative_axes_keepdims_example_eigen.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_negative_axes_keepdims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_sum_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_negative_axes_keepdims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_sum_negative_axes_keepdims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_negative_axes_keepdims_random_eigen.cc new file mode 100644 index 000000000..540d0efa4 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_negative_axes_keepdims_random_eigen.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_negative_axes_keepdims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_sum_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_negative_axes_keepdims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_sum_square_negative_axes_keepdims_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_square_negative_axes_keepdims_example_eigen.cc new file mode 100644 index 000000000..08a640285 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_square_negative_axes_keepdims_example_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_sum_square_negative_axes_keepdims_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_square_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_sum_square_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_square_negative_axes_keepdims_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reduce_sum_square_negative_axes_keepdims_random_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_square_negative_axes_keepdims_random_eigen.cc new file mode 100644 index 000000000..b66d23824 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reduce_sum_square_negative_axes_keepdims_random_eigen.cc @@ -0,0 +1,29 @@ +//===-test_reduce_sum_square_negative_axes_keepdims_random_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_square_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reduce_sum_square_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_square_negative_axes_keepdims_random_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reshape_negative_extended_dims_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reshape_negative_extended_dims_eigen.cc new file mode 100644 index 000000000..8db0624b3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reshape_negative_extended_dims_eigen.cc @@ -0,0 +1,30 @@ +//===-test_reshape_negative_extended_dims_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_negative_extended_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_negative_extended_dims/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reshape_negative_extended_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_negative_extended_dims_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reshape_reordered_all_dims_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reshape_reordered_all_dims_eigen.cc new file mode 100644 index 000000000..1aab89a42 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reshape_reordered_all_dims_eigen.cc @@ -0,0 +1,30 @@ +//===-test_reshape_reordered_all_dims_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_reordered_all_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_reordered_all_dims/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reshape_reordered_all_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_reordered_all_dims_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reshape_reordered_last_dims_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reshape_reordered_last_dims_eigen.cc new file mode 100644 index 000000000..f8d6b2472 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reshape_reordered_last_dims_eigen.cc @@ -0,0 +1,30 @@ +//===-test_reshape_reordered_last_dims_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_reordered_last_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_reordered_last_dims/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reshape_reordered_last_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_reordered_last_dims_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reshape_zero_and_negative_dim_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reshape_zero_and_negative_dim_eigen.cc new file mode 100644 index 000000000..5ca655e34 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reshape_zero_and_negative_dim_eigen.cc @@ -0,0 +1,30 @@ +//===-test_reshape_zero_and_negative_dim_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_zero_and_negative_dim/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_zero_and_negative_dim/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reshape_zero_and_negative_dim | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_zero_and_negative_dim_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_reshape_zero_dim_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_reshape_zero_dim_eigen.cc new file mode 100644 index 000000000..158fbd24a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_reshape_zero_dim_eigen.cc @@ -0,0 +1,30 @@ +//===-test_reshape_zero_dim_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_zero_dim/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_zero_dim/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_reshape_zero_dim | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_zero_dim_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc new file mode 100644 index 000000000..62484ed90 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_align_corners_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_align_corners_eigen.cc new file mode 100644 index 000000000..9f0803623 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_align_corners_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_align_corners_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_downsample_scales_cubic_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_align_corners_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_eigen.cc new file mode 100644 index 000000000..63806deaf --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_cubic_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_downsample_scales_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_linear_align_corners_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_linear_align_corners_eigen.cc new file mode 100644 index 000000000..7d8ec13ec --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_linear_align_corners_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_linear_align_corners_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_linear_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_downsample_scales_linear_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_linear_align_corners_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_linear_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_linear_eigen.cc new file mode 100644 index 000000000..cfa42de47 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_linear_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_linear_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_linear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_linear/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_downsample_scales_linear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_linear_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_nearest_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_nearest_eigen.cc new file mode 100644 index 000000000..b55bb3fb9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_scales_nearest_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_nearest_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_nearest/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_downsample_scales_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_nearest_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_cubic_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_cubic_eigen.cc new file mode 100644 index 000000000..ce37a1c91 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_cubic_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_cubic_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_cubic/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_downsample_sizes_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_cubic_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_linear_pytorch_half_pixel_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_linear_pytorch_half_pixel_eigen.cc new file mode 100644 index 000000000..9a1944692 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_linear_pytorch_half_pixel_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_linear_pytorch_half_pixel_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_linear_pytorch_half_pixel_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_nearest_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_nearest_eigen.cc new file mode 100644 index 000000000..2c796d280 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_nearest_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_nearest_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_nearest/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_downsample_sizes_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_nearest_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_eigen.cc new file mode 100644 index 000000000..21fbdc62c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_eigen.cc @@ -0,0 +1,32 @@ +//===-test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_tf_crop_and_resize_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_tf_crop_and_resize_eigen.cc new file mode 100644 index 000000000..07a913515 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_tf_crop_and_resize_eigen.cc @@ -0,0 +1,31 @@ +//===-test_resize_tf_crop_and_resize_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_tf_crop_and_resize/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_tf_crop_and_resize/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_tf_crop_and_resize | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_tf_crop_and_resize_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc new file mode 100644 index 000000000..c02c04e33 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_align_corners_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_align_corners_eigen.cc new file mode 100644 index 000000000..f017d56c0 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_align_corners_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_align_corners_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_scales_cubic_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_align_corners_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_asymmetric_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_asymmetric_eigen.cc new file mode 100644 index 000000000..0151c65d9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_asymmetric_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_asymmetric_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_asymmetric/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_scales_cubic_asymmetric | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_asymmetric_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_eigen.cc new file mode 100644 index 000000000..33e9da3ee --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_cubic_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_scales_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_linear_align_corners_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_linear_align_corners_eigen.cc new file mode 100644 index 000000000..604400a6d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_linear_align_corners_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_linear_align_corners_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_linear_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_scales_linear_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_linear_align_corners_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_linear_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_linear_eigen.cc new file mode 100644 index 000000000..fe8a1ead9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_linear_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_linear_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_linear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_linear/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_scales_linear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_linear_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_nearest_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_nearest_eigen.cc new file mode 100644 index 000000000..6d72cb355 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_scales_nearest_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_nearest_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_nearest/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_scales_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_nearest_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_cubic_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_cubic_eigen.cc new file mode 100644 index 000000000..19301d165 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_cubic_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_cubic_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_cubic/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_sizes_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_cubic_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_ceil_half_pixel_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_ceil_half_pixel_eigen.cc new file mode 100644 index 000000000..aba69c9d2 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_ceil_half_pixel_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_ceil_half_pixel_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_ceil_half_pixel_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_eigen.cc new file mode 100644 index 000000000..9f726f06a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_sizes_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_floor_align_corners_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_floor_align_corners_eigen.cc new file mode 100644 index 000000000..6cadfdad2 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_floor_align_corners_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_floor_align_corners_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_sizes_nearest_floor_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_floor_align_corners_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_eigen.cc new file mode 100644 index 000000000..681f8cadb --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_eigen.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_round_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_round_eigen.cc new file mode 100644 index 000000000..9aaac06fb --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_round_eigen.cc @@ -0,0 +1,29 @@ +//===-test_round_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_round/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_round/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_round/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_round/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_round/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_round/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_round | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_round_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_scatter_elements_with_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_scatter_elements_with_axis_eigen.cc new file mode 100644 index 000000000..621e6f428 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_scatter_elements_with_axis_eigen.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_with_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_with_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_with_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_scatter_elements_with_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_with_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_scatter_elements_with_negative_indices_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_scatter_elements_with_negative_indices_eigen.cc new file mode 100644 index 000000000..bab6d9cdc --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_scatter_elements_with_negative_indices_eigen.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_with_negative_indices_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_with_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_with_negative_indices/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_scatter_elements_with_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_with_negative_indices_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_scatter_elements_without_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_scatter_elements_without_axis_eigen.cc new file mode 100644 index 000000000..50182705d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_scatter_elements_without_axis_eigen.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_without_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_without_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_scatter_elements_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_without_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_scatternd_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_scatternd_eigen.cc new file mode 100644 index 000000000..4164a8ffb --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_scatternd_eigen.cc @@ -0,0 +1,31 @@ +//===-test_scatternd_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatternd/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatternd/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_scatternd | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatternd_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_eigen.cc new file mode 100644 index 000000000..baba07ba6 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1_mean_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_expanded_eigen.cc new file mode 100644 index 000000000..11d71b250 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_log_prob_eigen.cc new file mode 100644 index 000000000..96b3b85b6 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_log_prob_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..c8d9eefa2 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_eigen.cc new file mode 100644 index 000000000..6d50b3c09 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc new file mode 100644 index 000000000..a7777f1a3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_eigen.cc new file mode 100644 index 000000000..1de62cf9b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..677ed771b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_eigen.cc new file mode 100644 index 000000000..6f3b8cc07 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3_sum_weight_high_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc new file mode 100644 index 000000000..4f6746b90 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_eigen.cc new file mode 100644 index 000000000..62da5c496 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..22f55aff9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_eigen.cc new file mode 100644 index 000000000..c0c61c47a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3d4d5_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc new file mode 100644 index 000000000..bad08e7a1 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_eigen.cc new file mode 100644 index 000000000..50277dd65 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..0b5a02325 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_eigen.cc new file mode 100644 index 000000000..511a14006 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3d4d5_none_no_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc new file mode 100644 index 000000000..51e31049b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_eigen.cc new file mode 100644 index 000000000..7fb5dc563 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..f55a97ef8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_eigen.cc new file mode 100644 index 000000000..febb52ff2 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_3d_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_expanded_eigen.cc new file mode 100644 index 000000000..ba8766c08 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_3d_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_log_prob_eigen.cc new file mode 100644 index 000000000..1cec327e7 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_log_prob_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_3d_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..5d0f10a19 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_3d_log_prob_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_3d_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_eigen.cc new file mode 100644 index 000000000..879fb8e84 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_expanded_eigen.cc new file mode 100644 index 000000000..de80eeb40 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_log_prob_eigen.cc new file mode 100644 index 000000000..163cfda29 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_log_prob_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..0cfe42058 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_log_prob_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_eigen.cc new file mode 100644 index 000000000..06da16ccb --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_3d_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_expanded_eigen.cc new file mode 100644 index 000000000..8afa957f1 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_3d_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_log_prob_eigen.cc new file mode 100644 index 000000000..565d5945c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_log_prob_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_3d_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..7b5334e9a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_3d_log_prob_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_3d_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_eigen.cc new file mode 100644 index 000000000..bc4c40c42 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_4d_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_4d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_expanded_eigen.cc new file mode 100644 index 000000000..b55eef536 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_4d_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_4d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_log_prob_eigen.cc new file mode 100644 index 000000000..cb0ef2a8f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_log_prob_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_4d_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_4d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..f316dcfd5 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_4d_log_prob_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_4d_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_eigen.cc new file mode 100644 index 000000000..5239112b5 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_expanded_eigen.cc new file mode 100644 index 000000000..c5bc01a97 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_log_prob_eigen.cc new file mode 100644 index 000000000..d949941ef --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_log_prob_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..e11aa4afc --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_no_weight_ii_log_prob_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_no_weight_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_eigen.cc new file mode 100644 index 000000000..a281fa7bf --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_expanded_eigen.cc new file mode 100644 index 000000000..fd249b888 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_eigen.cc new file mode 100644 index 000000000..e39469a47 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_3d_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_expanded_eigen.cc new file mode 100644 index 000000000..28c59349b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_3d_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_log_prob_eigen.cc new file mode 100644 index 000000000..d64e0d407 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_log_prob_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_3d_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..95552aca9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_3d_log_prob_expanded_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_3d_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_eigen.cc new file mode 100644 index 000000000..3caa7ab17 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_4d_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_4d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_expanded_eigen.cc new file mode 100644 index 000000000..27660ae15 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_4d_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_4d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_log_prob_eigen.cc new file mode 100644 index 000000000..90e324885 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_log_prob_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_4d_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_4d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..38f0c6be5 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_4d_log_prob_expanded_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_4d_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_eigen.cc new file mode 100644 index 000000000..45133cddf --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_expanded_eigen.cc new file mode 100644 index 000000000..a28cd5319 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_log_prob_eigen.cc new file mode 100644 index 000000000..3c8382fab --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_log_prob_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..571fb032a --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_ii_log_prob_expanded_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_log_prob_eigen.cc new file mode 100644 index 000000000..f28354da1 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_log_prob_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..a4cbf492c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_mean_weight_log_prob_expanded_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_mean_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_none_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_none_eigen.cc new file mode 100644 index 000000000..63affe9e2 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_none_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_none_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_none | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_none_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_none_expanded_eigen.cc new file mode 100644 index 000000000..9cb7b74d1 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_none_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_none_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_none_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_none_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_none_log_prob_eigen.cc new file mode 100644 index 000000000..86cc3a72c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_none_log_prob_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_none_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_none_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_none_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..0c5b5da40 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_none_log_prob_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_none_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_eigen.cc new file mode 100644 index 000000000..5dde76fc9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_weights_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_none_weights | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_expanded_eigen.cc new file mode 100644 index 000000000..9292599d8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_weights_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_none_weights_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_log_prob_eigen.cc new file mode 100644 index 000000000..81850e7a7 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_log_prob_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_none_weights_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_none_weights_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..17bf2430d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_none_weights_log_prob_expanded_eigen.cc @@ -0,0 +1,32 @@ +//===-test_sce_none_weights_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_none_weights_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_sum_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_sum_eigen.cc new file mode 100644 index 000000000..04c216a5e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_sum_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_sum_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_sum_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_sum_expanded_eigen.cc new file mode 100644 index 000000000..babf1773e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_sum_expanded_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sce_sum_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_sum_log_prob_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_sum_log_prob_eigen.cc new file mode 100644 index 000000000..d88ca5987 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_sum_log_prob_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_sum_log_prob_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_log_prob/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_sum_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_log_prob_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sce_sum_log_prob_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sce_sum_log_prob_expanded_eigen.cc new file mode 100644 index 000000000..079f5365e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sce_sum_log_prob_expanded_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sce_sum_log_prob_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sce_sum_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_log_prob_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sequence_insert_at_back_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sequence_insert_at_back_eigen.cc new file mode 100644 index 000000000..df82ad2af --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sequence_insert_at_back_eigen.cc @@ -0,0 +1,30 @@ +//===-test_sequence_insert_at_back_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sequence_insert_at_back/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sequence_insert_at_back/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sequence_insert_at_back | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sequence_insert_at_back_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_sequence_insert_at_front_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_sequence_insert_at_front_eigen.cc new file mode 100644 index 000000000..a1a690113 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_sequence_insert_at_front_eigen.cc @@ -0,0 +1,31 @@ +//===-test_sequence_insert_at_front_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sequence_insert_at_front/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sequence_insert_at_front/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_sequence_insert_at_front | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sequence_insert_at_front_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_slice_negative_axes_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_slice_negative_axes_eigen.cc new file mode 100644 index 000000000..383dcef04 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_slice_negative_axes_eigen.cc @@ -0,0 +1,32 @@ +//===-test_slice_negative_axes_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_slice_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_slice_negative_axes/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_slice_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_slice_negative_axes_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_softmax_axis_0_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_softmax_axis_0_expanded_eigen.cc new file mode 100644 index 000000000..bd88f275c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_softmax_axis_0_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_0_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_0_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_0_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_0_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_0_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_0_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_0_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_softmax_axis_0_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_0_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_softmax_axis_1_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_softmax_axis_1_expanded_eigen.cc new file mode 100644 index 000000000..3912afbde --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_softmax_axis_1_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_1_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_1_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_softmax_axis_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_1_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_softmax_axis_2_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_softmax_axis_2_expanded_eigen.cc new file mode 100644 index 000000000..5b3f38ac9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_softmax_axis_2_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_2_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_2_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_softmax_axis_2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_2_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_softmax_default_axis_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_softmax_default_axis_expanded_eigen.cc new file mode 100644 index 000000000..35076e146 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_softmax_default_axis_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_softmax_default_axis_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_default_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_default_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_default_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_default_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_default_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_default_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_softmax_default_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_default_axis_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_softmax_example_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_softmax_example_expanded_eigen.cc new file mode 100644 index 000000000..109820e7f --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_softmax_example_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_softmax_example_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_example_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_example_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_example_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_example_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_example_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_example_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_softmax_example_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_example_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_softmax_large_number_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_softmax_large_number_expanded_eigen.cc new file mode 100644 index 000000000..0d02c08ba --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_softmax_large_number_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_softmax_large_number_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_large_number_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_large_number_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_large_number_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_large_number_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_large_number_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_large_number_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_softmax_large_number_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_large_number_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_softmax_negative_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_softmax_negative_axis_eigen.cc new file mode 100644 index 000000000..59378824e --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_softmax_negative_axis_eigen.cc @@ -0,0 +1,29 @@ +//===-test_softmax_negative_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_softmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_negative_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_softmax_negative_axis_expanded_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_softmax_negative_axis_expanded_eigen.cc new file mode 100644 index 000000000..8cfbc29f8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_softmax_negative_axis_expanded_eigen.cc @@ -0,0 +1,29 @@ +//===-test_softmax_negative_axis_expanded_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_negative_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_negative_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_softmax_negative_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_negative_axis_expanded_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_split_zero_size_splits_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_split_zero_size_splits_eigen.cc new file mode 100644 index 000000000..58038692c --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_split_zero_size_splits_eigen.cc @@ -0,0 +1,32 @@ +//===-test_split_zero_size_splits_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_split_zero_size_splits/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_split_zero_size_splits/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_split_zero_size_splits | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_split_zero_size_splits_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_squeeze_negative_axes_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_squeeze_negative_axes_eigen.cc new file mode 100644 index 000000000..28f5a12d3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_squeeze_negative_axes_eigen.cc @@ -0,0 +1,30 @@ +//===-test_squeeze_negative_axes_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_squeeze_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_squeeze_negative_axes/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_squeeze_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_squeeze_negative_axes_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_top_k_negative_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_top_k_negative_axis_eigen.cc new file mode 100644 index 000000000..c791cff84 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_top_k_negative_axis_eigen.cc @@ -0,0 +1,31 @@ +//===-test_top_k_negative_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_top_k_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_top_k_negative_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_top_k_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_top_k_negative_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_top_k_smallest_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_top_k_smallest_eigen.cc new file mode 100644 index 000000000..c88cddc22 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_top_k_smallest_eigen.cc @@ -0,0 +1,31 @@ +//===-test_top_k_smallest_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_top_k_smallest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_top_k_smallest/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_top_k_smallest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_top_k_smallest_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_training_dropout_default_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_training_dropout_default_eigen.cc new file mode 100644 index 000000000..b36d840d2 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_training_dropout_default_eigen.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_default_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_default/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_default/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_training_dropout_default | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_default_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_training_dropout_default_mask_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_training_dropout_default_mask_eigen.cc new file mode 100644 index 000000000..d8c7b836d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_training_dropout_default_mask_eigen.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_default_mask_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_default_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_default_mask/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_training_dropout_default_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_default_mask_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_training_dropout_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_training_dropout_eigen.cc new file mode 100644 index 000000000..004d7f4b7 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_training_dropout_eigen.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_training_dropout | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_training_dropout_mask_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_training_dropout_mask_eigen.cc new file mode 100644 index 000000000..636786cb8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_training_dropout_mask_eigen.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_mask_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_mask/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_training_dropout_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_mask_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_training_dropout_zero_ratio_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_training_dropout_zero_ratio_eigen.cc new file mode 100644 index 000000000..05036b1b6 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_training_dropout_zero_ratio_eigen.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_zero_ratio_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_zero_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_zero_ratio/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_training_dropout_zero_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_zero_ratio_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_training_dropout_zero_ratio_mask_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_training_dropout_zero_ratio_mask_eigen.cc new file mode 100644 index 000000000..7bb33e692 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_training_dropout_zero_ratio_mask_eigen.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_zero_ratio_mask_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_zero_ratio_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_zero_ratio_mask/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_training_dropout_zero_ratio_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_zero_ratio_mask_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unique_not_sorted_without_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unique_not_sorted_without_axis_eigen.cc new file mode 100644 index 000000000..de7d2875d --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unique_not_sorted_without_axis_eigen.cc @@ -0,0 +1,32 @@ +//===-test_unique_not_sorted_without_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_not_sorted_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_not_sorted_without_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unique_not_sorted_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_not_sorted_without_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_axis_3d_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_axis_3d_eigen.cc new file mode 100644 index 000000000..ef902afb3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_axis_3d_eigen.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_axis_3d_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_axis_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_axis_3d/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unique_sorted_with_axis_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_axis_3d_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_axis_eigen.cc new file mode 100644 index 000000000..e33927ecc --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_axis_eigen.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unique_sorted_with_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_negative_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_negative_axis_eigen.cc new file mode 100644 index 000000000..45173c020 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unique_sorted_with_negative_axis_eigen.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_negative_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_negative_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unique_sorted_with_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_negative_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unique_sorted_without_axis_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unique_sorted_without_axis_eigen.cc new file mode 100644 index 000000000..cccc61897 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unique_sorted_without_axis_eigen.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_without_axis_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_without_axis/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unique_sorted_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_without_axis_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_0_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_0_eigen.cc new file mode 100644 index 000000000..ee4e5100b --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_0_eigen.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_0_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_0/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unsqueeze_axis_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_0_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_1_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_1_eigen.cc new file mode 100644 index 000000000..2444594ec --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_1_eigen.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_1_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_1/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unsqueeze_axis_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_1_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_2_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_2_eigen.cc new file mode 100644 index 000000000..cbb83b767 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_2_eigen.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_2_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_2/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unsqueeze_axis_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_2_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_3_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_3_eigen.cc new file mode 100644 index 000000000..cc00b1b52 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_axis_3_eigen.cc @@ -0,0 +1,29 @@ +//===-test_unsqueeze_axis_3_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_3/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unsqueeze_axis_3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_3_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unsqueeze_negative_axes_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_negative_axes_eigen.cc new file mode 100644 index 000000000..b96df7840 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_negative_axes_eigen.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_negative_axes_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_negative_axes/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unsqueeze_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_negative_axes_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unsqueeze_three_axes_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_three_axes_eigen.cc new file mode 100644 index 000000000..8b19af956 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_three_axes_eigen.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_three_axes_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_three_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_three_axes/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unsqueeze_three_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_three_axes_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unsqueeze_two_axes_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_two_axes_eigen.cc new file mode 100644 index 000000000..57b50cba9 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_two_axes_eigen.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_two_axes_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_two_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_two_axes/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unsqueeze_two_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_two_axes_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_unsqueeze_unsorted_axes_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_unsorted_axes_eigen.cc new file mode 100644 index 000000000..62cb13ad3 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_unsqueeze_unsorted_axes_eigen.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_unsorted_axes_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_unsorted_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_unsorted_axes/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_unsqueeze_unsorted_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_unsorted_axes_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_eigen/test_where_long_example_eigen.cc b/tests/unittests/lit_cases/test_eigen/test_where_long_example_eigen.cc new file mode 100644 index 000000000..7ea0390a8 --- /dev/null +++ b/tests/unittests/lit_cases/test_eigen/test_where_long_example_eigen.cc @@ -0,0 +1,31 @@ +//===-test_where_long_example_eigen.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on eigen +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_where_long_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_where_long_example/test_data_set_0 %odla_link %device_link -lodla_eigen -o %t_eigen.exe -Wno-deprecated-declarations +// RUN: %t_eigen.exe 0.0001 0 eigen %data_path/test_where_long_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_where_long_example_eigen.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_adagrad_multiple_popart.cc b/tests/unittests/lit_cases/test_popart/test_adagrad_multiple_popart.cc new file mode 100644 index 000000000..982525591 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_adagrad_multiple_popart.cc @@ -0,0 +1,39 @@ +//===-test_adagrad_multiple_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adagrad_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adagrad_multiple/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_adagrad_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adagrad_multiple_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_adagrad_popart.cc b/tests/unittests/lit_cases/test_popart/test_adagrad_popart.cc new file mode 100644 index 000000000..c87e90e89 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_adagrad_popart.cc @@ -0,0 +1,34 @@ +//===-test_adagrad_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adagrad/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adagrad/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_adagrad | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adagrad_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_adam_multiple_popart.cc b/tests/unittests/lit_cases/test_popart/test_adam_multiple_popart.cc new file mode 100644 index 000000000..c5a48f967 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_adam_multiple_popart.cc @@ -0,0 +1,43 @@ +//===-test_adam_multiple_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_4.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_8.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_8.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_9.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_9.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_5.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_5.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adam_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adam_multiple/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_adam_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adam_multiple_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_adam_popart.cc b/tests/unittests/lit_cases/test_popart/test_adam_popart.cc new file mode 100644 index 000000000..7fa46e918 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_adam_popart.cc @@ -0,0 +1,36 @@ +//===-test_adam_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adam/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adam/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_adam | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adam_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmax_default_axis_example_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmax_default_axis_example_select_last_index_popart.cc new file mode 100644 index 000000000..73459a4d6 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmax_default_axis_example_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmax_default_axis_example_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_default_axis_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmax_default_axis_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_default_axis_example_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmax_default_axis_random_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmax_default_axis_random_select_last_index_popart.cc new file mode 100644 index 000000000..4534afb8a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmax_default_axis_random_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmax_default_axis_random_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_default_axis_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmax_default_axis_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_default_axis_random_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmax_keepdims_example_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmax_keepdims_example_select_last_index_popart.cc new file mode 100644 index 000000000..c65badd0c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmax_keepdims_example_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmax_keepdims_example_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmax_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_keepdims_example_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmax_keepdims_random_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmax_keepdims_random_select_last_index_popart.cc new file mode 100644 index 000000000..956bc6978 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmax_keepdims_random_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmax_keepdims_random_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmax_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_keepdims_random_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_example_popart.cc new file mode 100644 index 000000000..fff8a4eb8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmax_negative_axis_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_example_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_example_select_last_index_popart.cc new file mode 100644 index 000000000..2f18201ad --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_example_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_example_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmax_negative_axis_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_example_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_random_popart.cc new file mode 100644 index 000000000..258e353e8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_random_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmax_negative_axis_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_random_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_random_select_last_index_popart.cc new file mode 100644 index 000000000..6475a9fdf --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmax_negative_axis_keepdims_random_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_random_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmax_negative_axis_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_random_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmax_no_keepdims_example_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmax_no_keepdims_example_select_last_index_popart.cc new file mode 100644 index 000000000..76f0e642f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmax_no_keepdims_example_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmax_no_keepdims_example_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_no_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmax_no_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_no_keepdims_example_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmax_no_keepdims_random_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmax_no_keepdims_random_select_last_index_popart.cc new file mode 100644 index 000000000..8169c31ec --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmax_no_keepdims_random_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmax_no_keepdims_random_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_no_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmax_no_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_no_keepdims_random_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmin_default_axis_example_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmin_default_axis_example_select_last_index_popart.cc new file mode 100644 index 000000000..07420ec40 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmin_default_axis_example_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmin_default_axis_example_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_default_axis_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmin_default_axis_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_default_axis_example_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmin_default_axis_random_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmin_default_axis_random_select_last_index_popart.cc new file mode 100644 index 000000000..6f89e6391 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmin_default_axis_random_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmin_default_axis_random_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_default_axis_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmin_default_axis_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_default_axis_random_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmin_keepdims_example_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmin_keepdims_example_select_last_index_popart.cc new file mode 100644 index 000000000..52ffdf309 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmin_keepdims_example_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmin_keepdims_example_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmin_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_keepdims_example_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmin_keepdims_random_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmin_keepdims_random_select_last_index_popart.cc new file mode 100644 index 000000000..4f2f43777 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmin_keepdims_random_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmin_keepdims_random_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmin_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_keepdims_random_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_example_popart.cc new file mode 100644 index 000000000..d9475c5dc --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmin_negative_axis_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_example_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_example_select_last_index_popart.cc new file mode 100644 index 000000000..8e956bd8b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_example_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_example_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmin_negative_axis_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_example_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_random_popart.cc new file mode 100644 index 000000000..df82be34f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_random_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmin_negative_axis_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_random_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_random_select_last_index_popart.cc new file mode 100644 index 000000000..bbfbd3639 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmin_negative_axis_keepdims_random_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_random_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmin_negative_axis_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_random_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmin_no_keepdims_example_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmin_no_keepdims_example_select_last_index_popart.cc new file mode 100644 index 000000000..d89dd4338 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmin_no_keepdims_example_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmin_no_keepdims_example_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_no_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmin_no_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_no_keepdims_example_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_argmin_no_keepdims_random_select_last_index_popart.cc b/tests/unittests/lit_cases/test_popart/test_argmin_no_keepdims_random_select_last_index_popart.cc new file mode 100644 index 000000000..82cc3881d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_argmin_no_keepdims_random_select_last_index_popart.cc @@ -0,0 +1,29 @@ +//===-test_argmin_no_keepdims_random_select_last_index_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_no_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_argmin_no_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_no_keepdims_random_select_last_index_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint16_popart.cc b/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint16_popart.cc new file mode 100644 index 000000000..c87d24b04 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint16_popart.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_bitshift_left_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint32_popart.cc b/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint32_popart.cc new file mode 100644 index 000000000..76ee4c5cf --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint32_popart.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_bitshift_left_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint64_popart.cc b/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint64_popart.cc new file mode 100644 index 000000000..d2e80675a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint64_popart.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_bitshift_left_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint8_popart.cc b/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint8_popart.cc new file mode 100644 index 000000000..177d5ff88 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_bitshift_left_uint8_popart.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint8_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint8/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_bitshift_left_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint8_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint16_popart.cc b/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint16_popart.cc new file mode 100644 index 000000000..2a8c2cb8b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint16_popart.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_bitshift_right_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint32_popart.cc b/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint32_popart.cc new file mode 100644 index 000000000..9226fc644 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint32_popart.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_bitshift_right_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint64_popart.cc b/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint64_popart.cc new file mode 100644 index 000000000..b414aaa1a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint64_popart.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_bitshift_right_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint8_popart.cc b/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint8_popart.cc new file mode 100644 index 000000000..f33d665a6 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_bitshift_right_uint8_popart.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint8_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint8/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_bitshift_right_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint8_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_cast_BFLOAT16_to_FLOAT_popart.cc b/tests/unittests/lit_cases/test_popart/test_cast_BFLOAT16_to_FLOAT_popart.cc new file mode 100644 index 000000000..9a753d20a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_cast_BFLOAT16_to_FLOAT_popart.cc @@ -0,0 +1,29 @@ +//===-test_cast_BFLOAT16_to_FLOAT_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cast_BFLOAT16_to_FLOAT/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_cast_BFLOAT16_to_FLOAT | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cast_BFLOAT16_to_FLOAT_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_cast_FLOAT_to_BFLOAT16_popart.cc b/tests/unittests/lit_cases/test_popart/test_cast_FLOAT_to_BFLOAT16_popart.cc new file mode 100644 index 000000000..a837cea18 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_cast_FLOAT_to_BFLOAT16_popart.cc @@ -0,0 +1,29 @@ +//===-test_cast_FLOAT_to_BFLOAT16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cast_FLOAT_to_BFLOAT16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_cast_FLOAT_to_BFLOAT16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cast_FLOAT_to_BFLOAT16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_celu_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_celu_expanded_popart.cc new file mode 100644 index 000000000..c655eed33 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_celu_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_celu_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_celu_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_celu_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_celu_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_celu_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_celu_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_celu_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_celu_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_celu_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_celu_popart.cc b/tests/unittests/lit_cases/test_popart/test_celu_popart.cc new file mode 100644 index 000000000..112b64094 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_celu_popart.cc @@ -0,0 +1,29 @@ +//===-test_celu_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_celu/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_celu/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_celu/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_celu/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_celu/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_celu/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_celu | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_celu_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_clip_default_int8_inbounds_popart.cc b/tests/unittests/lit_cases/test_popart/test_clip_default_int8_inbounds_popart.cc new file mode 100644 index 000000000..5f9fc558b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_clip_default_int8_inbounds_popart.cc @@ -0,0 +1,29 @@ +//===-test_clip_default_int8_inbounds_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_inbounds/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_inbounds/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_inbounds/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_inbounds/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_inbounds/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_inbounds/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_clip_default_int8_inbounds | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_inbounds_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_clip_default_int8_max_popart.cc b/tests/unittests/lit_cases/test_popart/test_clip_default_int8_max_popart.cc new file mode 100644 index 000000000..f529f0bde --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_clip_default_int8_max_popart.cc @@ -0,0 +1,30 @@ +//===-test_clip_default_int8_max_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_max/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_max/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_clip_default_int8_max | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_max_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_clip_default_int8_min_popart.cc b/tests/unittests/lit_cases/test_popart/test_clip_default_int8_min_popart.cc new file mode 100644 index 000000000..c799249d2 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_clip_default_int8_min_popart.cc @@ -0,0 +1,30 @@ +//===-test_clip_default_int8_min_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_min/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_min/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_clip_default_int8_min | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_min_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_compress_negative_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_compress_negative_axis_popart.cc new file mode 100644 index 000000000..b6ab8816f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_compress_negative_axis_popart.cc @@ -0,0 +1,30 @@ +//===-test_compress_negative_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_compress_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_compress_negative_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_compress_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_compress_negative_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_concat_1d_axis_negative_1_popart.cc b/tests/unittests/lit_cases/test_popart/test_concat_1d_axis_negative_1_popart.cc new file mode 100644 index 000000000..450aef026 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_concat_1d_axis_negative_1_popart.cc @@ -0,0 +1,30 @@ +//===-test_concat_1d_axis_negative_1_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_1d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_1d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_concat_1d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_1d_axis_negative_1_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_concat_2d_axis_negative_1_popart.cc b/tests/unittests/lit_cases/test_popart/test_concat_2d_axis_negative_1_popart.cc new file mode 100644 index 000000000..5261257cf --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_concat_2d_axis_negative_1_popart.cc @@ -0,0 +1,30 @@ +//===-test_concat_2d_axis_negative_1_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_2d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_2d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_concat_2d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_2d_axis_negative_1_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_concat_2d_axis_negative_2_popart.cc b/tests/unittests/lit_cases/test_popart/test_concat_2d_axis_negative_2_popart.cc new file mode 100644 index 000000000..541874312 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_concat_2d_axis_negative_2_popart.cc @@ -0,0 +1,30 @@ +//===-test_concat_2d_axis_negative_2_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_2d_axis_negative_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_2d_axis_negative_2/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_concat_2d_axis_negative_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_2d_axis_negative_2_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_1_popart.cc b/tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_1_popart.cc new file mode 100644 index 000000000..38d071789 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_1_popart.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_1_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_concat_3d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_1_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_2_popart.cc b/tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_2_popart.cc new file mode 100644 index 000000000..b5b81c3e4 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_2_popart.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_2_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_2/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_concat_3d_axis_negative_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_2_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_3_popart.cc b/tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_3_popart.cc new file mode 100644 index 000000000..7a5ab7e1a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_concat_3d_axis_negative_3_popart.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_3_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_3/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_concat_3d_axis_negative_3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_3_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_constantofshape_int_shape_zero_popart.cc b/tests/unittests/lit_cases/test_popart/test_constantofshape_int_shape_zero_popart.cc new file mode 100644 index 000000000..06757178b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_constantofshape_int_shape_zero_popart.cc @@ -0,0 +1,29 @@ +//===-test_constantofshape_int_shape_zero_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_constantofshape_int_shape_zero/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_constantofshape_int_shape_zero/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_constantofshape_int_shape_zero/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_constantofshape_int_shape_zero/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_constantofshape_int_shape_zero/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_constantofshape_int_shape_zero/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_constantofshape_int_shape_zero | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_constantofshape_int_shape_zero_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_cumsum_1d_exclusive_popart.cc b/tests/unittests/lit_cases/test_popart/test_cumsum_1d_exclusive_popart.cc new file mode 100644 index 000000000..43a579cf0 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_cumsum_1d_exclusive_popart.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_exclusive_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_exclusive/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_exclusive/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_cumsum_1d_exclusive | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_exclusive_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_cumsum_1d_popart.cc b/tests/unittests/lit_cases/test_popart/test_cumsum_1d_popart.cc new file mode 100644 index 000000000..1a4902159 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_cumsum_1d_popart.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_cumsum_1d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_cumsum_1d_reverse_exclusive_popart.cc b/tests/unittests/lit_cases/test_popart/test_cumsum_1d_reverse_exclusive_popart.cc new file mode 100644 index 000000000..9c9f6ee0d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_cumsum_1d_reverse_exclusive_popart.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_reverse_exclusive_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_reverse_exclusive/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_cumsum_1d_reverse_exclusive | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_reverse_exclusive_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_cumsum_1d_reverse_popart.cc b/tests/unittests/lit_cases/test_popart/test_cumsum_1d_reverse_popart.cc new file mode 100644 index 000000000..2103fefdf --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_cumsum_1d_reverse_popart.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_reverse_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_reverse/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_reverse/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_cumsum_1d_reverse | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_reverse_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_cumsum_2d_axis_0_popart.cc b/tests/unittests/lit_cases/test_popart/test_cumsum_2d_axis_0_popart.cc new file mode 100644 index 000000000..023f586e4 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_cumsum_2d_axis_0_popart.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_axis_0_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_axis_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_axis_0/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_cumsum_2d_axis_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_axis_0_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_cumsum_2d_axis_1_popart.cc b/tests/unittests/lit_cases/test_popart/test_cumsum_2d_axis_1_popart.cc new file mode 100644 index 000000000..bda11824d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_cumsum_2d_axis_1_popart.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_axis_1_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_axis_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_axis_1/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_cumsum_2d_axis_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_axis_1_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_cumsum_2d_negative_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_cumsum_2d_negative_axis_popart.cc new file mode 100644 index 000000000..89cf69e70 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_cumsum_2d_negative_axis_popart.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_negative_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_negative_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_cumsum_2d_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_negative_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_depthtospace_crd_mode_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_depthtospace_crd_mode_example_popart.cc new file mode 100644 index 000000000..13f8ec9e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_depthtospace_crd_mode_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_crd_mode_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_crd_mode_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_crd_mode_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_depthtospace_crd_mode_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_crd_mode_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_depthtospace_crd_mode_popart.cc b/tests/unittests/lit_cases/test_popart/test_depthtospace_crd_mode_popart.cc new file mode 100644 index 000000000..7b218a9c5 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_depthtospace_crd_mode_popart.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_crd_mode_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_crd_mode/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_crd_mode/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_depthtospace_crd_mode | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_crd_mode_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_depthtospace_dcr_mode_popart.cc b/tests/unittests/lit_cases/test_popart/test_depthtospace_dcr_mode_popart.cc new file mode 100644 index 000000000..65d4d6d02 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_depthtospace_dcr_mode_popart.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_dcr_mode_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_dcr_mode/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_dcr_mode/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_dcr_mode/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_dcr_mode/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_dcr_mode/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_dcr_mode/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_depthtospace_dcr_mode | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_dcr_mode_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dequantizelinear_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_dequantizelinear_axis_popart.cc new file mode 100644 index 000000000..ab5e530ac --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dequantizelinear_axis_popart.cc @@ -0,0 +1,31 @@ +//===-test_dequantizelinear_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dequantizelinear_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dequantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dequantizelinear_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dequantizelinear_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_det_2d_popart.cc b/tests/unittests/lit_cases/test_popart/test_det_2d_popart.cc new file mode 100644 index 000000000..14f336d22 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_det_2d_popart.cc @@ -0,0 +1,29 @@ +//===-test_det_2d_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_det_2d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_det_2d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_det_2d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_det_2d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_det_2d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_det_2d/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_det_2d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_det_2d_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_det_nd_popart.cc b/tests/unittests/lit_cases/test_popart/test_det_nd_popart.cc new file mode 100644 index 000000000..109d01aa8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_det_nd_popart.cc @@ -0,0 +1,29 @@ +//===-test_det_nd_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_det_nd/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_det_nd/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_det_nd/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_det_nd/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_det_nd/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_det_nd/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_det_nd | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_det_nd_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dropout_default_mask_popart.cc b/tests/unittests/lit_cases/test_popart/test_dropout_default_mask_popart.cc new file mode 100644 index 000000000..63cfa8220 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dropout_default_mask_popart.cc @@ -0,0 +1,30 @@ +//===-test_dropout_default_mask_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_mask/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dropout_default_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_mask_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dropout_default_mask_ratio_popart.cc b/tests/unittests/lit_cases/test_popart/test_dropout_default_mask_ratio_popart.cc new file mode 100644 index 000000000..6dd24a13c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dropout_default_mask_ratio_popart.cc @@ -0,0 +1,31 @@ +//===-test_dropout_default_mask_ratio_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_mask_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_mask_ratio/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dropout_default_mask_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_mask_ratio_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dropout_default_old_popart.cc b/tests/unittests/lit_cases/test_popart/test_dropout_default_old_popart.cc new file mode 100644 index 000000000..6134527da --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dropout_default_old_popart.cc @@ -0,0 +1,29 @@ +//===-test_dropout_default_old_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_old/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_old/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_old/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_old/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_old/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_old/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dropout_default_old | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_old_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dropout_default_ratio_popart.cc b/tests/unittests/lit_cases/test_popart/test_dropout_default_ratio_popart.cc new file mode 100644 index 000000000..1c811f0ac --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dropout_default_ratio_popart.cc @@ -0,0 +1,30 @@ +//===-test_dropout_default_ratio_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_ratio/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dropout_default_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_ratio_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dropout_random_old_popart.cc b/tests/unittests/lit_cases/test_popart/test_dropout_random_old_popart.cc new file mode 100644 index 000000000..febae66e0 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dropout_random_old_popart.cc @@ -0,0 +1,29 @@ +//===-test_dropout_random_old_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_random_old/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_random_old/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_random_old/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_random_old/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_random_old/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_random_old/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dropout_random_old | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_random_old_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_expanded_popart.cc new file mode 100644 index 000000000..0c14fd45d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dynamicquantizelinear_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_max_adjusted_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_max_adjusted_expanded_popart.cc new file mode 100644 index 000000000..53bb486ac --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_max_adjusted_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_max_adjusted_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_max_adjusted_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dynamicquantizelinear_max_adjusted_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_max_adjusted_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_max_adjusted_popart.cc b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_max_adjusted_popart.cc new file mode 100644 index 000000000..bf76bef75 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_max_adjusted_popart.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_max_adjusted_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_max_adjusted/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dynamicquantizelinear_max_adjusted | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_max_adjusted_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_min_adjusted_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_min_adjusted_expanded_popart.cc new file mode 100644 index 000000000..4c4575bc3 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_min_adjusted_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_min_adjusted_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_min_adjusted_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dynamicquantizelinear_min_adjusted_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_min_adjusted_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_min_adjusted_popart.cc b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_min_adjusted_popart.cc new file mode 100644 index 000000000..6a7114985 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_min_adjusted_popart.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_min_adjusted_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_min_adjusted/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dynamicquantizelinear_min_adjusted | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_min_adjusted_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_popart.cc b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_popart.cc new file mode 100644 index 000000000..ce5ccf854 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_dynamicquantizelinear_popart.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_dynamicquantizelinear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_einsum_batch_diagonal_popart.cc b/tests/unittests/lit_cases/test_popart/test_einsum_batch_diagonal_popart.cc new file mode 100644 index 000000000..742013532 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_einsum_batch_diagonal_popart.cc @@ -0,0 +1,29 @@ +//===-test_einsum_batch_diagonal_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_diagonal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_diagonal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_diagonal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_diagonal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_batch_diagonal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_batch_diagonal/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_einsum_batch_diagonal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_batch_diagonal_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_einsum_batch_matmul_popart.cc b/tests/unittests/lit_cases/test_popart/test_einsum_batch_matmul_popart.cc new file mode 100644 index 000000000..8a568f6c0 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_einsum_batch_matmul_popart.cc @@ -0,0 +1,30 @@ +//===-test_einsum_batch_matmul_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_batch_matmul/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_batch_matmul/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_einsum_batch_matmul | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_batch_matmul_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_einsum_inner_prod_popart.cc b/tests/unittests/lit_cases/test_popart/test_einsum_inner_prod_popart.cc new file mode 100644 index 000000000..f422d5752 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_einsum_inner_prod_popart.cc @@ -0,0 +1,30 @@ +//===-test_einsum_inner_prod_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_inner_prod/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_inner_prod/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_einsum_inner_prod | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_inner_prod_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_einsum_sum_popart.cc b/tests/unittests/lit_cases/test_popart/test_einsum_sum_popart.cc new file mode 100644 index 000000000..daea62025 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_einsum_sum_popart.cc @@ -0,0 +1,29 @@ +//===-test_einsum_sum_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_sum/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_einsum_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_sum_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_einsum_transpose_popart.cc b/tests/unittests/lit_cases/test_popart/test_einsum_transpose_popart.cc new file mode 100644 index 000000000..be2132f56 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_einsum_transpose_popart.cc @@ -0,0 +1,29 @@ +//===-test_einsum_transpose_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_transpose/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_transpose/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_transpose/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_transpose/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_transpose/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_transpose/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_einsum_transpose | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_transpose_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis1_popart.cc b/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis1_popart.cc new file mode 100644 index 000000000..f6391097e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis1_popart.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis1_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis1/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_flatten_negative_axis1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis1_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis2_popart.cc b/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis2_popart.cc new file mode 100644 index 000000000..423fd557b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis2_popart.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis2_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis2/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_flatten_negative_axis2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis2_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis3_popart.cc b/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis3_popart.cc new file mode 100644 index 000000000..528e099ef --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis3_popart.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis3_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis3/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_flatten_negative_axis3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis3_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis4_popart.cc b/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis4_popart.cc new file mode 100644 index 000000000..bf50d6a78 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_flatten_negative_axis4_popart.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis4_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis4/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis4/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis4/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis4/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis4/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis4/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_flatten_negative_axis4 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis4_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gather_2d_indices_popart.cc b/tests/unittests/lit_cases/test_popart/test_gather_2d_indices_popart.cc new file mode 100644 index 000000000..0c3055f1a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gather_2d_indices_popart.cc @@ -0,0 +1,30 @@ +//===-test_gather_2d_indices_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_2d_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_2d_indices/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gather_2d_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_2d_indices_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gather_elements_0_popart.cc b/tests/unittests/lit_cases/test_popart/test_gather_elements_0_popart.cc new file mode 100644 index 000000000..f320cefd8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gather_elements_0_popart.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_0_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_0/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gather_elements_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_0_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gather_elements_1_popart.cc b/tests/unittests/lit_cases/test_popart/test_gather_elements_1_popart.cc new file mode 100644 index 000000000..488d7f1a3 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gather_elements_1_popart.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_1_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_1/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gather_elements_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_1_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gather_elements_negative_indices_popart.cc b/tests/unittests/lit_cases/test_popart/test_gather_elements_negative_indices_popart.cc new file mode 100644 index 000000000..f3d1fe816 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gather_elements_negative_indices_popart.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_negative_indices_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_negative_indices/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gather_elements_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_negative_indices_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gather_negative_indices_popart.cc b/tests/unittests/lit_cases/test_popart/test_gather_negative_indices_popart.cc new file mode 100644 index 000000000..56e5d8973 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gather_negative_indices_popart.cc @@ -0,0 +1,30 @@ +//===-test_gather_negative_indices_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_negative_indices/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gather_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_negative_indices_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gathernd_example_float32_popart.cc b/tests/unittests/lit_cases/test_popart/test_gathernd_example_float32_popart.cc new file mode 100644 index 000000000..9f42b2602 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gathernd_example_float32_popart.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_float32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_float32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gathernd_example_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_float32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gathernd_example_int32_batch_dim1_popart.cc b/tests/unittests/lit_cases/test_popart/test_gathernd_example_int32_batch_dim1_popart.cc new file mode 100644 index 000000000..0fb1f86dd --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gathernd_example_int32_batch_dim1_popart.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_int32_batch_dim1_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_int32_batch_dim1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gathernd_example_int32_batch_dim1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_int32_batch_dim1_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gathernd_example_int32_popart.cc b/tests/unittests/lit_cases/test_popart/test_gathernd_example_int32_popart.cc new file mode 100644 index 000000000..3232a6a02 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gathernd_example_int32_popart.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_int32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_int32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gathernd_example_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_int32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_all_attributes_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_all_attributes_popart.cc new file mode 100644 index 000000000..6949f1f9c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_all_attributes_popart.cc @@ -0,0 +1,31 @@ +//===-test_gemm_all_attributes_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_all_attributes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_all_attributes/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_all_attributes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_all_attributes_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_alpha_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_alpha_popart.cc new file mode 100644 index 000000000..0eaf413db --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_alpha_popart.cc @@ -0,0 +1,31 @@ +//===-test_gemm_alpha_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_alpha/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_alpha/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_alpha | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_alpha_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_beta_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_beta_popart.cc new file mode 100644 index 000000000..beb081731 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_beta_popart.cc @@ -0,0 +1,31 @@ +//===-test_gemm_beta_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_beta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_beta/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_beta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_beta_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_default_matrix_bias_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_default_matrix_bias_popart.cc new file mode 100644 index 000000000..a2055e0f8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_default_matrix_bias_popart.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_matrix_bias_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_matrix_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_matrix_bias/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_default_matrix_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_matrix_bias_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_default_no_bias_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_default_no_bias_popart.cc new file mode 100644 index 000000000..c7c14dfc7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_default_no_bias_popart.cc @@ -0,0 +1,30 @@ +//===-test_gemm_default_no_bias_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_no_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_no_bias/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_default_no_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_no_bias_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_default_scalar_bias_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_default_scalar_bias_popart.cc new file mode 100644 index 000000000..5e45a1828 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_default_scalar_bias_popart.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_scalar_bias_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_scalar_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_scalar_bias/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_default_scalar_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_scalar_bias_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_default_single_elem_vector_bias_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_default_single_elem_vector_bias_popart.cc new file mode 100644 index 000000000..77bdb722c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_default_single_elem_vector_bias_popart.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_single_elem_vector_bias_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_single_elem_vector_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_default_single_elem_vector_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_single_elem_vector_bias_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_default_vector_bias_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_default_vector_bias_popart.cc new file mode 100644 index 000000000..4a520a68d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_default_vector_bias_popart.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_vector_bias_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_vector_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_vector_bias/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_default_vector_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_vector_bias_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_default_zero_bias_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_default_zero_bias_popart.cc new file mode 100644 index 000000000..9ee12d30d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_default_zero_bias_popart.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_zero_bias_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_zero_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_zero_bias/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_default_zero_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_zero_bias_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_transposeA_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_transposeA_popart.cc new file mode 100644 index 000000000..2079316a1 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_transposeA_popart.cc @@ -0,0 +1,31 @@ +//===-test_gemm_transposeA_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_transposeA/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_transposeA/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_transposeA | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_transposeA_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_gemm_transposeB_popart.cc b/tests/unittests/lit_cases/test_popart/test_gemm_transposeB_popart.cc new file mode 100644 index 000000000..c6b881ac1 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_gemm_transposeB_popart.cc @@ -0,0 +1,31 @@ +//===-test_gemm_transposeB_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_transposeB/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_transposeB/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_gemm_transposeB | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_transposeB_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_greater_equal_bcast_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_greater_equal_bcast_expanded_popart.cc new file mode 100644 index 000000000..f867830fc --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_greater_equal_bcast_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_bcast_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_bcast_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_bcast_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_greater_equal_bcast_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_bcast_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_greater_equal_bcast_popart.cc b/tests/unittests/lit_cases/test_popart/test_greater_equal_bcast_popart.cc new file mode 100644 index 000000000..cb11c5e11 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_greater_equal_bcast_popart.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_bcast_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_bcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_bcast/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_greater_equal_bcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_bcast_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_greater_equal_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_greater_equal_expanded_popart.cc new file mode 100644 index 000000000..47d768b4f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_greater_equal_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_greater_equal_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_greater_equal_popart.cc b/tests/unittests/lit_cases/test_popart/test_greater_equal_popart.cc new file mode 100644 index 000000000..4e1d2b60f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_greater_equal_popart.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_greater_equal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_hardmax_negative_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_hardmax_negative_axis_popart.cc new file mode 100644 index 000000000..c921401f9 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_hardmax_negative_axis_popart.cc @@ -0,0 +1,29 @@ +//===-test_hardmax_negative_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_hardmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_hardmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_hardmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_hardmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_hardmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_hardmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_hardmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_hardmax_negative_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_if_popart.cc b/tests/unittests/lit_cases/test_popart/test_if_popart.cc new file mode 100644 index 000000000..23a876c32 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_if_popart.cc @@ -0,0 +1,29 @@ +//===-test_if_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_if/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_if/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_if/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_if/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_if/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_if/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_if | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_if_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_if_seq_popart.cc b/tests/unittests/lit_cases/test_popart/test_if_seq_popart.cc new file mode 100644 index 000000000..f82af8b25 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_if_seq_popart.cc @@ -0,0 +1,29 @@ +//===-test_if_seq_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_if_seq/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_if_seq/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_if_seq/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_if_seq/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_if_seq/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_if_seq/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_if_seq | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_if_seq_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_less_equal_bcast_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_less_equal_bcast_expanded_popart.cc new file mode 100644 index 000000000..e4ed9ce93 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_less_equal_bcast_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_bcast_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_bcast_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_bcast_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_less_equal_bcast_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_bcast_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_less_equal_bcast_popart.cc b/tests/unittests/lit_cases/test_popart/test_less_equal_bcast_popart.cc new file mode 100644 index 000000000..55f1e8e64 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_less_equal_bcast_popart.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_bcast_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_bcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_bcast/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_less_equal_bcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_bcast_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_less_equal_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_less_equal_expanded_popart.cc new file mode 100644 index 000000000..bec30ee72 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_less_equal_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_less_equal_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_less_equal_popart.cc b/tests/unittests/lit_cases/test_popart/test_less_equal_popart.cc new file mode 100644 index 000000000..3000a3af7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_less_equal_popart.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_less_equal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_0_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_0_expanded_popart.cc new file mode 100644 index 000000000..8178d0d16 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_0_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_0_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_0_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_0_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_logsoftmax_axis_0_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_0_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_1_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_1_expanded_popart.cc new file mode 100644 index 000000000..a048d7548 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_1_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_1_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_1_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_logsoftmax_axis_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_1_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_2_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_2_expanded_popart.cc new file mode 100644 index 000000000..23c931a9c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_logsoftmax_axis_2_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_2_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_2_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_logsoftmax_axis_2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_2_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_logsoftmax_default_axis_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_logsoftmax_default_axis_expanded_popart.cc new file mode 100644 index 000000000..bdca78088 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_logsoftmax_default_axis_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_default_axis_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_default_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_default_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_logsoftmax_default_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_default_axis_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_logsoftmax_example_1_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_logsoftmax_example_1_expanded_popart.cc new file mode 100644 index 000000000..39f570427 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_logsoftmax_example_1_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_example_1_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_example_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_example_1_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_logsoftmax_example_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_example_1_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_logsoftmax_large_number_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_logsoftmax_large_number_expanded_popart.cc new file mode 100644 index 000000000..b30d8790a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_logsoftmax_large_number_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_large_number_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_large_number_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_large_number_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_logsoftmax_large_number_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_large_number_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_logsoftmax_negative_axis_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_logsoftmax_negative_axis_expanded_popart.cc new file mode 100644 index 000000000..97ccc2507 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_logsoftmax_negative_axis_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_negative_axis_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_negative_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_logsoftmax_negative_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_negative_axis_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_logsoftmax_negative_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_logsoftmax_negative_axis_popart.cc new file mode 100644 index 000000000..62b97a203 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_logsoftmax_negative_axis_popart.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_negative_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_logsoftmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_negative_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_loop11_popart.cc b/tests/unittests/lit_cases/test_popart/test_loop11_popart.cc new file mode 100644 index 000000000..6b3826b06 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_loop11_popart.cc @@ -0,0 +1,32 @@ +//===-test_loop11_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_loop11/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_loop11/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_loop11 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_loop11_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_loop13_seq_popart.cc b/tests/unittests/lit_cases/test_popart/test_loop13_seq_popart.cc new file mode 100644 index 000000000..bba9b39c9 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_loop13_seq_popart.cc @@ -0,0 +1,31 @@ +//===-test_loop13_seq_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_loop13_seq/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_loop13_seq/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_loop13_seq | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_loop13_seq_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_float16_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_float16_popart.cc new file mode 100644 index 000000000..e5b505405 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_float16_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_float16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_float32_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_float32_popart.cc new file mode 100644 index 000000000..e510db345 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_float32_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_float32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_float64_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_float64_popart.cc new file mode 100644 index 000000000..83a4d7e0a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_float64_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_float64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_int16_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_int16_popart.cc new file mode 100644 index 000000000..4883b6de7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_int16_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_int16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_int32_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_int32_popart.cc new file mode 100644 index 000000000..5c75d9b3d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_int32_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_int32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_int64_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_int64_popart.cc new file mode 100644 index 000000000..13ab77948 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_int64_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_int64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_int8_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_int8_popart.cc new file mode 100644 index 000000000..b37c011af --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_int8_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_int8_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int8/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int8_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_uint16_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_uint16_popart.cc new file mode 100644 index 000000000..1d5587b5d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_uint16_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_uint16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_uint32_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_uint32_popart.cc new file mode 100644 index 000000000..7dd23bcd9 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_uint32_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_uint32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_uint64_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_uint64_popart.cc new file mode 100644 index 000000000..cd0dc1446 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_uint64_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_uint64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_max_uint8_popart.cc b/tests/unittests/lit_cases/test_popart/test_max_uint8_popart.cc new file mode 100644 index 000000000..35ba673f1 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_max_uint8_popart.cc @@ -0,0 +1,30 @@ +//===-test_max_uint8_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint8/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_max_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint8_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_maxpool_2d_uint8_popart.cc b/tests/unittests/lit_cases/test_popart/test_maxpool_2d_uint8_popart.cc new file mode 100644 index 000000000..0c9a74948 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_maxpool_2d_uint8_popart.cc @@ -0,0 +1,29 @@ +//===-test_maxpool_2d_uint8_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_maxpool_2d_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_maxpool_2d_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_maxpool_2d_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_maxpool_2d_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_maxpool_2d_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_maxpool_2d_uint8/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_maxpool_2d_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_maxpool_2d_uint8_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_float16_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_float16_popart.cc new file mode 100644 index 000000000..7c8f258b8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_float16_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_float16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_float32_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_float32_popart.cc new file mode 100644 index 000000000..eb4eb8ab6 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_float32_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_float32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_float64_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_float64_popart.cc new file mode 100644 index 000000000..af184fec3 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_float64_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_float64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_int16_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_int16_popart.cc new file mode 100644 index 000000000..0726a8600 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_int16_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_int16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_int32_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_int32_popart.cc new file mode 100644 index 000000000..7704b786e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_int32_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_int32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_int64_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_int64_popart.cc new file mode 100644 index 000000000..a2ddf038f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_int64_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_int64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_int8_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_int8_popart.cc new file mode 100644 index 000000000..69781ea2b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_int8_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_int8_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int8/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int8_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_uint16_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_uint16_popart.cc new file mode 100644 index 000000000..398e18a3f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_uint16_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_uint16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_uint32_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_uint32_popart.cc new file mode 100644 index 000000000..11fc0b593 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_uint32_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_uint32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_uint64_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_uint64_popart.cc new file mode 100644 index 000000000..c9fa1223c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_uint64_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_uint64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_min_uint8_popart.cc b/tests/unittests/lit_cases/test_popart/test_min_uint8_popart.cc new file mode 100644 index 000000000..f8fecf376 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_min_uint8_popart.cc @@ -0,0 +1,30 @@ +//===-test_min_uint8_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint8/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_min_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint8_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_broadcast_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_broadcast_popart.cc new file mode 100644 index 000000000..e07f3eb70 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_broadcast_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_broadcast_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_broadcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_broadcast/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_broadcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_broadcast_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_int64_fmod_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_int64_fmod_popart.cc new file mode 100644 index 000000000..ea19abc73 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_int64_fmod_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_int64_fmod_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_int64_fmod/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_int64_fmod/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_int64_fmod | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_int64_fmod_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float16_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float16_popart.cc new file mode 100644 index 000000000..c1617d458 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float16_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_mixed_sign_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float32_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float32_popart.cc new file mode 100644 index 000000000..0911de448 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float32_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_mixed_sign_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float64_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float64_popart.cc new file mode 100644 index 000000000..fe7b961ff --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_float64_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_mixed_sign_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int16_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int16_popart.cc new file mode 100644 index 000000000..e664f2ec6 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int16_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_mixed_sign_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int32_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int32_popart.cc new file mode 100644 index 000000000..09d35dc8c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int32_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_mixed_sign_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int64_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int64_popart.cc new file mode 100644 index 000000000..e026b959c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int64_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_mixed_sign_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int8_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int8_popart.cc new file mode 100644 index 000000000..5fba527fa --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_mixed_sign_int8_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int8_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int8/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_mixed_sign_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int8_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_uint16_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_uint16_popart.cc new file mode 100644 index 000000000..6a5824a74 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_uint16_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint16_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint16/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint16_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_uint32_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_uint32_popart.cc new file mode 100644 index 000000000..739146f59 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_uint32_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_uint64_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_uint64_popart.cc new file mode 100644 index 000000000..b0541cfd8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_uint64_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_mod_uint8_popart.cc b/tests/unittests/lit_cases/test_popart/test_mod_uint8_popart.cc new file mode 100644 index 000000000..37ceb0b3e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_mod_uint8_popart.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint8_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint8/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_mod_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint8_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_momentum_multiple_popart.cc b/tests/unittests/lit_cases/test_popart/test_momentum_multiple_popart.cc new file mode 100644 index 000000000..2046a95a2 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_momentum_multiple_popart.cc @@ -0,0 +1,39 @@ +//===-test_momentum_multiple_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_momentum_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_momentum_multiple/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_momentum_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_momentum_multiple_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_momentum_popart.cc b/tests/unittests/lit_cases/test_popart/test_momentum_popart.cc new file mode 100644 index 000000000..7d8ec5726 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_momentum_popart.cc @@ -0,0 +1,34 @@ +//===-test_momentum_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_momentum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_momentum/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_momentum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_momentum_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nesterov_momentum_popart.cc b/tests/unittests/lit_cases/test_popart/test_nesterov_momentum_popart.cc new file mode 100644 index 000000000..a73743453 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nesterov_momentum_popart.cc @@ -0,0 +1,34 @@ +//===-test_nesterov_momentum_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nesterov_momentum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nesterov_momentum/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nesterov_momentum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nesterov_momentum_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NC_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NC_expanded_popart.cc new file mode 100644 index 000000000..1f9388bda --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NC_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NC_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NC_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NC_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NC_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NC_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NC_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NC_popart.cc new file mode 100644 index 000000000..db50f08cd --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NC_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NC_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NC/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NC/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NC | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NC_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_expanded_popart.cc new file mode 100644 index 000000000..b053463d3 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_ii_expanded_popart.cc new file mode 100644 index 000000000..626b56624 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_ii_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_ii_popart.cc new file mode 100644 index 000000000..3a06c3253 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_ii_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_mean_weight_negative_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_mean_weight_negative_ii_expanded_popart.cc new file mode 100644 index 000000000..b9b018da3 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_mean_weight_negative_ii_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_mean_weight_negative_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_mean_weight_negative_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_mean_weight_negative_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_mean_weight_negative_ii_popart.cc new file mode 100644 index 000000000..0cc762938 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_mean_weight_negative_ii_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_mean_weight_negative_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_mean_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1_mean_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_mean_weight_negative_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_popart.cc new file mode 100644 index 000000000..341e179a6 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_expanded_popart.cc new file mode 100644 index 000000000..2e7ee8672 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_ii_expanded_popart.cc new file mode 100644 index 000000000..8792c283a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_ii_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_ii_popart.cc new file mode 100644 index 000000000..9e86b398f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_ii_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_popart.cc new file mode 100644 index 000000000..791b8f51a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1_weight_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_expanded_popart.cc new file mode 100644 index 000000000..2bdc82c4c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_popart.cc new file mode 100644 index 000000000..b38567179 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_popart.cc new file mode 100644 index 000000000..b71cb8f87 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_no_weight_reduction_mean_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_no_weight_reduction_mean_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_popart.cc new file mode 100644 index 000000000..98e2b8812 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_mean_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_mean_expanded_popart.cc new file mode 100644 index 000000000..7281cea42 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_mean_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_mean_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_reduction_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_mean_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_mean_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_mean_popart.cc new file mode 100644 index 000000000..2a50cbc39 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_mean_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_mean_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_reduction_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_mean_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_sum_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_sum_expanded_popart.cc new file mode 100644 index 000000000..7a3f8e6ec --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_sum_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_sum_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_reduction_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_sum_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_sum_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_sum_popart.cc new file mode 100644 index 000000000..3b23d4163 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_reduction_sum_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_sum_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_reduction_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_sum_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_expanded_popart.cc new file mode 100644 index 000000000..736247d08 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_with_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_popart.cc new file mode 100644 index 000000000..0e0dd767a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_with_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_popart.cc new file mode 100644 index 000000000..54fc1cb24 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_mean_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_mean_popart.cc new file mode 100644 index 000000000..ca65b2875 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_mean_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_mean_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_mean_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_popart.cc new file mode 100644 index 000000000..b4924d2c7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_popart.cc new file mode 100644 index 000000000..18219fc99 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_popart.cc new file mode 100644 index 000000000..5fe9b5980 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_popart.cc new file mode 100644 index 000000000..73c4da40a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2_with_weight_reduction_sum_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc new file mode 100644 index 000000000..2fe0394c7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_popart.cc new file mode 100644 index 000000000..30de9f7d8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3_none_no_weight_negative_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_none_no_weight_negative_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc new file mode 100644 index 000000000..499cd023f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_sum_weight_high_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_sum_weight_high_ii_popart.cc new file mode 100644 index 000000000..035acdd63 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3_sum_weight_high_ii_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3_sum_weight_high_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_sum_weight_high_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_popart.cc new file mode 100644 index 000000000..c4d023146 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_mean_weight_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_mean_weight_popart.cc new file mode 100644 index 000000000..c0adb2d60 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_mean_weight_popart.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3d4d5_mean_weight_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_mean_weight_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc new file mode 100644 index 000000000..9d462ec65 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_none_no_weight_popart.cc b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_none_no_weight_popart.cc new file mode 100644 index 000000000..3a671af8a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_nllloss_NCd1d2d3d4d5_none_no_weight_popart.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3d4d5_none_no_weight_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_none_no_weight_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_onehot_negative_indices_popart.cc b/tests/unittests/lit_cases/test_popart/test_onehot_negative_indices_popart.cc new file mode 100644 index 000000000..19bf92590 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_onehot_negative_indices_popart.cc @@ -0,0 +1,31 @@ +//===-test_onehot_negative_indices_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_onehot_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_onehot_negative_indices/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_onehot_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_onehot_negative_indices_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_onehot_with_negative_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_onehot_with_negative_axis_popart.cc new file mode 100644 index 000000000..f28f03ee9 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_onehot_with_negative_axis_popart.cc @@ -0,0 +1,31 @@ +//===-test_onehot_with_negative_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_onehot_with_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_onehot_with_negative_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_onehot_with_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_onehot_with_negative_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_pow_types_float32_int32_popart.cc b/tests/unittests/lit_cases/test_popart/test_pow_types_float32_int32_popart.cc new file mode 100644 index 000000000..812ba1df2 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_pow_types_float32_int32_popart.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_int32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_int32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_pow_types_float32_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_int32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_pow_types_float32_int64_popart.cc b/tests/unittests/lit_cases/test_popart/test_pow_types_float32_int64_popart.cc new file mode 100644 index 000000000..2942cd512 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_pow_types_float32_int64_popart.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_int64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_int64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_pow_types_float32_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_int64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_pow_types_float32_uint32_popart.cc b/tests/unittests/lit_cases/test_popart/test_pow_types_float32_uint32_popart.cc new file mode 100644 index 000000000..a5a67af4e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_pow_types_float32_uint32_popart.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_uint32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_uint32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_pow_types_float32_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_uint32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_pow_types_float32_uint64_popart.cc b/tests/unittests/lit_cases/test_popart/test_pow_types_float32_uint64_popart.cc new file mode 100644 index 000000000..4d8a9d2b8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_pow_types_float32_uint64_popart.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_uint64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_uint64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_pow_types_float32_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_uint64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_pow_types_float_popart.cc b/tests/unittests/lit_cases/test_popart/test_pow_types_float_popart.cc new file mode 100644 index 000000000..47530658a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_pow_types_float_popart.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_pow_types_float | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_pow_types_int32_float32_popart.cc b/tests/unittests/lit_cases/test_popart/test_pow_types_int32_float32_popart.cc new file mode 100644 index 000000000..2b38a9a81 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_pow_types_int32_float32_popart.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int32_float32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int32_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int32_float32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_pow_types_int32_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int32_float32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_pow_types_int32_int32_popart.cc b/tests/unittests/lit_cases/test_popart/test_pow_types_int32_int32_popart.cc new file mode 100644 index 000000000..337ed219b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_pow_types_int32_int32_popart.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int32_int32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int32_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int32_int32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_pow_types_int32_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int32_int32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_pow_types_int64_float32_popart.cc b/tests/unittests/lit_cases/test_popart/test_pow_types_int64_float32_popart.cc new file mode 100644 index 000000000..3725bd113 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_pow_types_int64_float32_popart.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int64_float32_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int64_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int64_float32/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_pow_types_int64_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int64_float32_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_pow_types_int64_int64_popart.cc b/tests/unittests/lit_cases/test_popart/test_pow_types_int64_int64_popart.cc new file mode 100644 index 000000000..c7d4a5ee1 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_pow_types_int64_int64_popart.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int64_int64_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int64_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int64_int64/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_pow_types_int64_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int64_int64_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_pow_types_int_popart.cc b/tests/unittests/lit_cases/test_popart/test_pow_types_int_popart.cc new file mode 100644 index 000000000..8cd71c698 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_pow_types_int_popart.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_pow_types_int | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_quantizelinear_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_quantizelinear_axis_popart.cc new file mode 100644 index 000000000..f07f71c91 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_quantizelinear_axis_popart.cc @@ -0,0 +1,31 @@ +//===-test_quantizelinear_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_quantizelinear_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_quantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_quantizelinear_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_quantizelinear_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_range_float_type_positive_delta_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_range_float_type_positive_delta_expanded_popart.cc new file mode 100644 index 000000000..4e9fe9b86 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_range_float_type_positive_delta_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_range_float_type_positive_delta_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_float_type_positive_delta_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_float_type_positive_delta_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_range_float_type_positive_delta_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_float_type_positive_delta_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_range_float_type_positive_delta_popart.cc b/tests/unittests/lit_cases/test_popart/test_range_float_type_positive_delta_popart.cc new file mode 100644 index 000000000..978cbf55a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_range_float_type_positive_delta_popart.cc @@ -0,0 +1,31 @@ +//===-test_range_float_type_positive_delta_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_float_type_positive_delta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_float_type_positive_delta/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_range_float_type_positive_delta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_float_type_positive_delta_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_range_int32_type_negative_delta_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_range_int32_type_negative_delta_expanded_popart.cc new file mode 100644 index 000000000..92739a64b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_range_int32_type_negative_delta_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_range_int32_type_negative_delta_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_int32_type_negative_delta_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_range_int32_type_negative_delta_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_int32_type_negative_delta_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_range_int32_type_negative_delta_popart.cc b/tests/unittests/lit_cases/test_popart/test_range_int32_type_negative_delta_popart.cc new file mode 100644 index 000000000..bc3d8ef03 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_range_int32_type_negative_delta_popart.cc @@ -0,0 +1,31 @@ +//===-test_range_int32_type_negative_delta_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_int32_type_negative_delta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_int32_type_negative_delta/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_range_int32_type_negative_delta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_int32_type_negative_delta_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_l1_negative_axes_keep_dims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_l1_negative_axes_keep_dims_example_popart.cc new file mode 100644 index 000000000..2976a1bf9 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_l1_negative_axes_keep_dims_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l1_negative_axes_keep_dims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l1_negative_axes_keep_dims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_l1_negative_axes_keep_dims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l1_negative_axes_keep_dims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_l1_negative_axes_keep_dims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_l1_negative_axes_keep_dims_random_popart.cc new file mode 100644 index 000000000..72cbb3339 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_l1_negative_axes_keep_dims_random_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l1_negative_axes_keep_dims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l1_negative_axes_keep_dims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_l1_negative_axes_keep_dims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l1_negative_axes_keep_dims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_l2_negative_axes_keep_dims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_l2_negative_axes_keep_dims_example_popart.cc new file mode 100644 index 000000000..ce85b45ac --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_l2_negative_axes_keep_dims_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l2_negative_axes_keep_dims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l2_negative_axes_keep_dims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_l2_negative_axes_keep_dims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l2_negative_axes_keep_dims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_l2_negative_axes_keep_dims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_l2_negative_axes_keep_dims_random_popart.cc new file mode 100644 index 000000000..4ddb92623 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_l2_negative_axes_keep_dims_random_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l2_negative_axes_keep_dims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l2_negative_axes_keep_dims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_l2_negative_axes_keep_dims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l2_negative_axes_keep_dims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_log_sum_exp_negative_axes_keepdims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_log_sum_exp_negative_axes_keepdims_example_popart.cc new file mode 100644 index 000000000..ab19e4f75 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_log_sum_exp_negative_axes_keepdims_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_exp_negative_axes_keepdims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_exp_negative_axes_keepdims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_log_sum_exp_negative_axes_keepdims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_log_sum_exp_negative_axes_keepdims_random_popart.cc new file mode 100644 index 000000000..c66d2c2ca --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_log_sum_exp_negative_axes_keepdims_random_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_exp_negative_axes_keepdims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_exp_negative_axes_keepdims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_log_sum_negative_axes_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_log_sum_negative_axes_popart.cc new file mode 100644 index 000000000..ba61086ba --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_log_sum_negative_axes_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_negative_axes_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_negative_axes/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_log_sum_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_negative_axes_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_max_negative_axes_keepdims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_max_negative_axes_keepdims_example_popart.cc new file mode 100644 index 000000000..674927d7c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_max_negative_axes_keepdims_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_max_negative_axes_keepdims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_max_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_max_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_max_negative_axes_keepdims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_max_negative_axes_keepdims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_max_negative_axes_keepdims_random_popart.cc new file mode 100644 index 000000000..0773808d6 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_max_negative_axes_keepdims_random_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_max_negative_axes_keepdims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_max_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_max_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_max_negative_axes_keepdims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_mean_negative_axes_keepdims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_mean_negative_axes_keepdims_example_popart.cc new file mode 100644 index 000000000..ecde897e9 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_mean_negative_axes_keepdims_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_mean_negative_axes_keepdims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_mean_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_mean_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_mean_negative_axes_keepdims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_mean_negative_axes_keepdims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_mean_negative_axes_keepdims_random_popart.cc new file mode 100644 index 000000000..5ff12350f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_mean_negative_axes_keepdims_random_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_mean_negative_axes_keepdims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_mean_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_mean_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_mean_negative_axes_keepdims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_min_negative_axes_keepdims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_min_negative_axes_keepdims_example_popart.cc new file mode 100644 index 000000000..76073ac0b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_min_negative_axes_keepdims_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_min_negative_axes_keepdims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_min_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_min_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_min_negative_axes_keepdims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_min_negative_axes_keepdims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_min_negative_axes_keepdims_random_popart.cc new file mode 100644 index 000000000..1af6a8572 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_min_negative_axes_keepdims_random_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_min_negative_axes_keepdims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_min_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_min_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_min_negative_axes_keepdims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_prod_negative_axes_keepdims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_prod_negative_axes_keepdims_example_popart.cc new file mode 100644 index 000000000..4eb0be4e8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_prod_negative_axes_keepdims_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_prod_negative_axes_keepdims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_prod_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_prod_negative_axes_keepdims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_prod_negative_axes_keepdims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_prod_negative_axes_keepdims_random_popart.cc new file mode 100644 index 000000000..e4e37f5c3 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_prod_negative_axes_keepdims_random_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_prod_negative_axes_keepdims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_prod_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_prod_negative_axes_keepdims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_sum_empty_axes_input_noop_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_sum_empty_axes_input_noop_example_popart.cc new file mode 100644 index 000000000..f9b77124e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_sum_empty_axes_input_noop_example_popart.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_empty_axes_input_noop_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_empty_axes_input_noop_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_sum_empty_axes_input_noop_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_empty_axes_input_noop_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_sum_empty_axes_input_noop_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_sum_empty_axes_input_noop_random_popart.cc new file mode 100644 index 000000000..b4778a78d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_sum_empty_axes_input_noop_random_popart.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_empty_axes_input_noop_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_empty_axes_input_noop_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_sum_empty_axes_input_noop_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_empty_axes_input_noop_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_sum_negative_axes_keepdims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_sum_negative_axes_keepdims_example_popart.cc new file mode 100644 index 000000000..f8b51fe47 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_sum_negative_axes_keepdims_example_popart.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_negative_axes_keepdims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_sum_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_negative_axes_keepdims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_sum_negative_axes_keepdims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_sum_negative_axes_keepdims_random_popart.cc new file mode 100644 index 000000000..99ca5967c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_sum_negative_axes_keepdims_random_popart.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_negative_axes_keepdims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_sum_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_negative_axes_keepdims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_sum_square_negative_axes_keepdims_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_sum_square_negative_axes_keepdims_example_popart.cc new file mode 100644 index 000000000..ddfd7cd58 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_sum_square_negative_axes_keepdims_example_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_sum_square_negative_axes_keepdims_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_square_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_sum_square_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_square_negative_axes_keepdims_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reduce_sum_square_negative_axes_keepdims_random_popart.cc b/tests/unittests/lit_cases/test_popart/test_reduce_sum_square_negative_axes_keepdims_random_popart.cc new file mode 100644 index 000000000..d9e3563ee --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reduce_sum_square_negative_axes_keepdims_random_popart.cc @@ -0,0 +1,29 @@ +//===-test_reduce_sum_square_negative_axes_keepdims_random_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_square_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reduce_sum_square_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_square_negative_axes_keepdims_random_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reshape_negative_extended_dims_popart.cc b/tests/unittests/lit_cases/test_popart/test_reshape_negative_extended_dims_popart.cc new file mode 100644 index 000000000..8d1a9529b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reshape_negative_extended_dims_popart.cc @@ -0,0 +1,30 @@ +//===-test_reshape_negative_extended_dims_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_negative_extended_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_negative_extended_dims/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reshape_negative_extended_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_negative_extended_dims_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reshape_reordered_all_dims_popart.cc b/tests/unittests/lit_cases/test_popart/test_reshape_reordered_all_dims_popart.cc new file mode 100644 index 000000000..47d38874a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reshape_reordered_all_dims_popart.cc @@ -0,0 +1,30 @@ +//===-test_reshape_reordered_all_dims_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_reordered_all_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_reordered_all_dims/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reshape_reordered_all_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_reordered_all_dims_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reshape_reordered_last_dims_popart.cc b/tests/unittests/lit_cases/test_popart/test_reshape_reordered_last_dims_popart.cc new file mode 100644 index 000000000..e7dfc64e0 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reshape_reordered_last_dims_popart.cc @@ -0,0 +1,30 @@ +//===-test_reshape_reordered_last_dims_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_reordered_last_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_reordered_last_dims/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reshape_reordered_last_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_reordered_last_dims_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reshape_zero_and_negative_dim_popart.cc b/tests/unittests/lit_cases/test_popart/test_reshape_zero_and_negative_dim_popart.cc new file mode 100644 index 000000000..bb0089f14 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reshape_zero_and_negative_dim_popart.cc @@ -0,0 +1,30 @@ +//===-test_reshape_zero_and_negative_dim_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_zero_and_negative_dim/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_zero_and_negative_dim/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reshape_zero_and_negative_dim | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_zero_and_negative_dim_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_reshape_zero_dim_popart.cc b/tests/unittests/lit_cases/test_popart/test_reshape_zero_dim_popart.cc new file mode 100644 index 000000000..c948ef506 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_reshape_zero_dim_popart.cc @@ -0,0 +1,30 @@ +//===-test_reshape_zero_dim_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_zero_dim/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_zero_dim/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_reshape_zero_dim | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_zero_dim_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_popart.cc new file mode 100644 index 000000000..3eccdb2bf --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_align_corners_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_align_corners_popart.cc new file mode 100644 index 000000000..7117cf90a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_align_corners_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_align_corners_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_downsample_scales_cubic_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_align_corners_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_popart.cc new file mode 100644 index 000000000..7d05c710d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_cubic_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_downsample_scales_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_linear_align_corners_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_linear_align_corners_popart.cc new file mode 100644 index 000000000..a7795490d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_linear_align_corners_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_linear_align_corners_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_linear_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_downsample_scales_linear_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_linear_align_corners_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_linear_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_linear_popart.cc new file mode 100644 index 000000000..add60d749 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_linear_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_linear_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_linear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_linear/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_downsample_scales_linear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_linear_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_nearest_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_nearest_popart.cc new file mode 100644 index 000000000..0d23d0078 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_downsample_scales_nearest_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_nearest_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_nearest/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_downsample_scales_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_nearest_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_cubic_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_cubic_popart.cc new file mode 100644 index 000000000..88f34274e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_cubic_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_cubic_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_cubic/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_downsample_sizes_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_cubic_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_linear_pytorch_half_pixel_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_linear_pytorch_half_pixel_popart.cc new file mode 100644 index 000000000..bde39184f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_linear_pytorch_half_pixel_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_linear_pytorch_half_pixel_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_linear_pytorch_half_pixel_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_nearest_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_nearest_popart.cc new file mode 100644 index 000000000..1d3ba1c11 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_nearest_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_nearest_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_nearest/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_downsample_sizes_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_nearest_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_popart.cc new file mode 100644 index 000000000..9d77691b1 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_popart.cc @@ -0,0 +1,32 @@ +//===-test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_tf_crop_and_resize_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_tf_crop_and_resize_popart.cc new file mode 100644 index 000000000..952a1285a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_tf_crop_and_resize_popart.cc @@ -0,0 +1,31 @@ +//===-test_resize_tf_crop_and_resize_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_tf_crop_and_resize/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_tf_crop_and_resize/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_tf_crop_and_resize | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_tf_crop_and_resize_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_popart.cc new file mode 100644 index 000000000..37e5f19b7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_align_corners_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_align_corners_popart.cc new file mode 100644 index 000000000..dec47328d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_align_corners_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_align_corners_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_scales_cubic_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_align_corners_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_asymmetric_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_asymmetric_popart.cc new file mode 100644 index 000000000..a58803bff --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_asymmetric_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_asymmetric_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_asymmetric/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_scales_cubic_asymmetric | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_asymmetric_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_popart.cc new file mode 100644 index 000000000..de976cdf0 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_cubic_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_scales_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_linear_align_corners_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_linear_align_corners_popart.cc new file mode 100644 index 000000000..ecef6819d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_linear_align_corners_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_linear_align_corners_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_linear_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_scales_linear_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_linear_align_corners_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_linear_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_linear_popart.cc new file mode 100644 index 000000000..57ea8ef13 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_linear_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_linear_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_linear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_linear/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_scales_linear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_linear_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_nearest_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_nearest_popart.cc new file mode 100644 index 000000000..82fed3ae7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_scales_nearest_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_nearest_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_nearest/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_scales_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_nearest_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_cubic_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_cubic_popart.cc new file mode 100644 index 000000000..fa01f4a6e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_cubic_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_cubic_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_cubic/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_sizes_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_cubic_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_ceil_half_pixel_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_ceil_half_pixel_popart.cc new file mode 100644 index 000000000..ac44353b9 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_ceil_half_pixel_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_ceil_half_pixel_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_ceil_half_pixel_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_floor_align_corners_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_floor_align_corners_popart.cc new file mode 100644 index 000000000..141c43029 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_floor_align_corners_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_floor_align_corners_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_sizes_nearest_floor_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_floor_align_corners_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_popart.cc new file mode 100644 index 000000000..35b41f88a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_sizes_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_popart.cc b/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_popart.cc new file mode 100644 index 000000000..2319abf68 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_popart.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_round_popart.cc b/tests/unittests/lit_cases/test_popart/test_round_popart.cc new file mode 100644 index 000000000..2da5daeae --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_round_popart.cc @@ -0,0 +1,29 @@ +//===-test_round_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_round/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_round/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_round/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_round/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_round/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_round/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_round | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_round_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_scatter_elements_with_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_scatter_elements_with_axis_popart.cc new file mode 100644 index 000000000..b40c93a03 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_scatter_elements_with_axis_popart.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_with_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_with_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_with_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_scatter_elements_with_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_with_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_scatter_elements_with_negative_indices_popart.cc b/tests/unittests/lit_cases/test_popart/test_scatter_elements_with_negative_indices_popart.cc new file mode 100644 index 000000000..cdee5201d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_scatter_elements_with_negative_indices_popart.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_with_negative_indices_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_with_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_with_negative_indices/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_scatter_elements_with_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_with_negative_indices_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_scatter_elements_without_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_scatter_elements_without_axis_popart.cc new file mode 100644 index 000000000..00ca9f9dd --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_scatter_elements_without_axis_popart.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_without_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_without_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_scatter_elements_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_without_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_scatternd_popart.cc b/tests/unittests/lit_cases/test_popart/test_scatternd_popart.cc new file mode 100644 index 000000000..b120263f9 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_scatternd_popart.cc @@ -0,0 +1,31 @@ +//===-test_scatternd_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatternd/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatternd/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_scatternd | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatternd_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_expanded_popart.cc new file mode 100644 index 000000000..b02e1e5f5 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_popart.cc new file mode 100644 index 000000000..dd4254d4c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_log_prob_popart.cc new file mode 100644 index 000000000..045d2ddab --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_log_prob_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_popart.cc new file mode 100644 index 000000000..bc1b4ec07 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1_mean_weight_negative_ii_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1_mean_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc new file mode 100644 index 000000000..fe3df9dfc --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_popart.cc new file mode 100644 index 000000000..bafacb20e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_popart.cc new file mode 100644 index 000000000..321c04748 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_popart.cc new file mode 100644 index 000000000..c0a782c23 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_none_no_weight_negative_ii_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc new file mode 100644 index 000000000..8f174dff1 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_popart.cc new file mode 100644 index 000000000..c26244970 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_popart.cc new file mode 100644 index 000000000..515257f0f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_popart.cc new file mode 100644 index 000000000..31961e1e5 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3_sum_weight_high_ii_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3_sum_weight_high_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_expanded_popart.cc new file mode 100644 index 000000000..90d4cbed8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_popart.cc new file mode 100644 index 000000000..f91155c5b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_popart.cc new file mode 100644 index 000000000..506cf923f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_popart.cc new file mode 100644 index 000000000..084d0ce0f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_mean_weight_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3d4d5_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc new file mode 100644 index 000000000..04feb794b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_popart.cc new file mode 100644 index 000000000..97228ceca --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_popart.cc new file mode 100644 index 000000000..de2ec0126 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_popart.cc new file mode 100644 index 000000000..b6fa2deab --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_NCd1d2d3d4d5_none_no_weight_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_NCd1d2d3d4d5_none_no_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_expanded_popart.cc new file mode 100644 index 000000000..074da2423 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_3d_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_log_prob_expanded_popart.cc new file mode 100644 index 000000000..ceed1df48 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_log_prob_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_3d_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_log_prob_popart.cc new file mode 100644 index 000000000..a7624ae2a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_log_prob_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_3d_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_popart.cc new file mode 100644 index 000000000..15069c8e9 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_3d_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_3d_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_expanded_popart.cc new file mode 100644 index 000000000..6f83c98d6 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_log_prob_expanded_popart.cc new file mode 100644 index 000000000..508d27e47 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_log_prob_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_log_prob_popart.cc new file mode 100644 index 000000000..be65efdc6 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_log_prob_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_expanded_popart.cc new file mode 100644 index 000000000..762d9b7e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_3d_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_log_prob_expanded_popart.cc new file mode 100644 index 000000000..74a074b0a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_log_prob_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_3d_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_log_prob_popart.cc new file mode 100644 index 000000000..9e2c662af --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_log_prob_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_3d_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_popart.cc new file mode 100644 index 000000000..5c0f0f2a0 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_3d_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_3d_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_expanded_popart.cc new file mode 100644 index 000000000..968d99184 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_4d_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_4d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_log_prob_expanded_popart.cc new file mode 100644 index 000000000..2a4abccec --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_log_prob_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_4d_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_log_prob_popart.cc new file mode 100644 index 000000000..b8469a0b2 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_log_prob_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_4d_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_4d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_popart.cc new file mode 100644 index 000000000..358475776 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_4d_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_4d_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_4d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_expanded_popart.cc new file mode 100644 index 000000000..96955ab65 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_log_prob_expanded_popart.cc new file mode 100644 index 000000000..fcc0d107b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_log_prob_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_log_prob_popart.cc new file mode 100644 index 000000000..ba36f8633 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_log_prob_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_popart.cc new file mode 100644 index 000000000..eeb74ada7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_no_weight_ii_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_no_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_popart.cc new file mode 100644 index 000000000..3c6b9630a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_expanded_popart.cc new file mode 100644 index 000000000..f5552287b --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_expanded_popart.cc new file mode 100644 index 000000000..69bad001e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_3d_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_log_prob_expanded_popart.cc new file mode 100644 index 000000000..5a4501558 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_log_prob_expanded_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_3d_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_log_prob_popart.cc new file mode 100644 index 000000000..8509a74ab --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_log_prob_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_3d_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_popart.cc new file mode 100644 index 000000000..0a6b0b0c0 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_3d_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_3d_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_expanded_popart.cc new file mode 100644 index 000000000..48d4dd37d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_4d_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_4d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_log_prob_expanded_popart.cc new file mode 100644 index 000000000..846e0d5fd --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_log_prob_expanded_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_4d_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_log_prob_popart.cc new file mode 100644 index 000000000..9cbf16ae0 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_log_prob_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_4d_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_4d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_popart.cc new file mode 100644 index 000000000..e4896dc19 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_4d_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_4d_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_4d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_expanded_popart.cc new file mode 100644 index 000000000..d6d9dc44c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_log_prob_expanded_popart.cc new file mode 100644 index 000000000..7280bc35e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_log_prob_expanded_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_log_prob_popart.cc new file mode 100644 index 000000000..cd149ba21 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_log_prob_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_popart.cc new file mode 100644 index 000000000..ee050d455 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_ii_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_log_prob_expanded_popart.cc new file mode 100644 index 000000000..925aa8561 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_log_prob_expanded_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_log_prob_popart.cc new file mode 100644 index 000000000..21ffd12dd --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_log_prob_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_popart.cc new file mode 100644 index 000000000..536579701 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_mean_weight_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_none_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_none_expanded_popart.cc new file mode 100644 index 000000000..cbb3fec86 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_none_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_none_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_none_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_none_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_none_log_prob_expanded_popart.cc new file mode 100644 index 000000000..cfeb6abc0 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_none_log_prob_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_none_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_none_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_none_log_prob_popart.cc new file mode 100644 index 000000000..2181ac195 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_none_log_prob_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_none_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_none_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_none_popart.cc new file mode 100644 index 000000000..27f692ad8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_none_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_none_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_none | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_none_weights_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_none_weights_expanded_popart.cc new file mode 100644 index 000000000..9f0785599 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_none_weights_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_weights_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_none_weights_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_none_weights_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_none_weights_log_prob_expanded_popart.cc new file mode 100644 index 000000000..de2fec63c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_none_weights_log_prob_expanded_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_none_weights_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_none_weights_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_none_weights_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_none_weights_log_prob_popart.cc new file mode 100644 index 000000000..e83b17cdf --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_none_weights_log_prob_popart.cc @@ -0,0 +1,32 @@ +//===-test_sce_none_weights_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_none_weights_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_none_weights_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_none_weights_popart.cc new file mode 100644 index 000000000..4b0900d77 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_none_weights_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_weights_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_none_weights | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_sum_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_sum_expanded_popart.cc new file mode 100644 index 000000000..ffcbf48c5 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_sum_expanded_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_sum_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_sum_log_prob_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_sum_log_prob_expanded_popart.cc new file mode 100644 index 000000000..0b1db99d8 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_sum_log_prob_expanded_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_sum_log_prob_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_sum_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_log_prob_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_sum_log_prob_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_sum_log_prob_popart.cc new file mode 100644 index 000000000..c9026b79d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_sum_log_prob_popart.cc @@ -0,0 +1,31 @@ +//===-test_sce_sum_log_prob_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_log_prob/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_sum_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_log_prob_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sce_sum_popart.cc b/tests/unittests/lit_cases/test_popart/test_sce_sum_popart.cc new file mode 100644 index 000000000..d218cac53 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sce_sum_popart.cc @@ -0,0 +1,30 @@ +//===-test_sce_sum_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sce_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sequence_insert_at_back_popart.cc b/tests/unittests/lit_cases/test_popart/test_sequence_insert_at_back_popart.cc new file mode 100644 index 000000000..efb0b5e5c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sequence_insert_at_back_popart.cc @@ -0,0 +1,30 @@ +//===-test_sequence_insert_at_back_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sequence_insert_at_back/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sequence_insert_at_back/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sequence_insert_at_back | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sequence_insert_at_back_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_sequence_insert_at_front_popart.cc b/tests/unittests/lit_cases/test_popart/test_sequence_insert_at_front_popart.cc new file mode 100644 index 000000000..cdd1a7013 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_sequence_insert_at_front_popart.cc @@ -0,0 +1,31 @@ +//===-test_sequence_insert_at_front_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sequence_insert_at_front/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sequence_insert_at_front/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_sequence_insert_at_front | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sequence_insert_at_front_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_slice_negative_axes_popart.cc b/tests/unittests/lit_cases/test_popart/test_slice_negative_axes_popart.cc new file mode 100644 index 000000000..d824312ce --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_slice_negative_axes_popart.cc @@ -0,0 +1,32 @@ +//===-test_slice_negative_axes_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_slice_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_slice_negative_axes/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_slice_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_slice_negative_axes_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_softmax_axis_0_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_softmax_axis_0_expanded_popart.cc new file mode 100644 index 000000000..1230ce272 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_softmax_axis_0_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_0_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_0_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_0_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_0_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_0_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_0_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_0_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_softmax_axis_0_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_0_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_softmax_axis_1_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_softmax_axis_1_expanded_popart.cc new file mode 100644 index 000000000..3705fade2 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_softmax_axis_1_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_1_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_1_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_softmax_axis_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_1_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_softmax_axis_2_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_softmax_axis_2_expanded_popart.cc new file mode 100644 index 000000000..f125bd65f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_softmax_axis_2_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_2_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_2_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_softmax_axis_2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_2_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_softmax_default_axis_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_softmax_default_axis_expanded_popart.cc new file mode 100644 index 000000000..814976037 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_softmax_default_axis_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_softmax_default_axis_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_default_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_default_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_default_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_default_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_default_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_default_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_softmax_default_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_default_axis_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_softmax_example_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_softmax_example_expanded_popart.cc new file mode 100644 index 000000000..009518b6f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_softmax_example_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_softmax_example_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_example_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_example_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_example_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_example_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_example_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_example_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_softmax_example_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_example_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_softmax_large_number_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_softmax_large_number_expanded_popart.cc new file mode 100644 index 000000000..493c463df --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_softmax_large_number_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_softmax_large_number_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_large_number_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_large_number_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_large_number_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_large_number_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_large_number_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_large_number_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_softmax_large_number_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_large_number_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_softmax_negative_axis_expanded_popart.cc b/tests/unittests/lit_cases/test_popart/test_softmax_negative_axis_expanded_popart.cc new file mode 100644 index 000000000..61ac08f6f --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_softmax_negative_axis_expanded_popart.cc @@ -0,0 +1,29 @@ +//===-test_softmax_negative_axis_expanded_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_negative_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_negative_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_softmax_negative_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_negative_axis_expanded_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_softmax_negative_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_softmax_negative_axis_popart.cc new file mode 100644 index 000000000..4c7a2f3e1 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_softmax_negative_axis_popart.cc @@ -0,0 +1,29 @@ +//===-test_softmax_negative_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_softmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_negative_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_split_zero_size_splits_popart.cc b/tests/unittests/lit_cases/test_popart/test_split_zero_size_splits_popart.cc new file mode 100644 index 000000000..cc57fc6e1 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_split_zero_size_splits_popart.cc @@ -0,0 +1,32 @@ +//===-test_split_zero_size_splits_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_split_zero_size_splits/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_split_zero_size_splits/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_split_zero_size_splits | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_split_zero_size_splits_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_squeeze_negative_axes_popart.cc b/tests/unittests/lit_cases/test_popart/test_squeeze_negative_axes_popart.cc new file mode 100644 index 000000000..168d2feab --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_squeeze_negative_axes_popart.cc @@ -0,0 +1,30 @@ +//===-test_squeeze_negative_axes_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_squeeze_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_squeeze_negative_axes/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_squeeze_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_squeeze_negative_axes_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_top_k_negative_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_top_k_negative_axis_popart.cc new file mode 100644 index 000000000..f1611d2f7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_top_k_negative_axis_popart.cc @@ -0,0 +1,31 @@ +//===-test_top_k_negative_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_top_k_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_top_k_negative_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_top_k_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_top_k_negative_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_top_k_smallest_popart.cc b/tests/unittests/lit_cases/test_popart/test_top_k_smallest_popart.cc new file mode 100644 index 000000000..1fe247106 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_top_k_smallest_popart.cc @@ -0,0 +1,31 @@ +//===-test_top_k_smallest_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_top_k_smallest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_top_k_smallest/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_top_k_smallest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_top_k_smallest_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_training_dropout_default_mask_popart.cc b/tests/unittests/lit_cases/test_popart/test_training_dropout_default_mask_popart.cc new file mode 100644 index 000000000..c178d4c82 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_training_dropout_default_mask_popart.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_default_mask_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_default_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_default_mask/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_training_dropout_default_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_default_mask_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_training_dropout_default_popart.cc b/tests/unittests/lit_cases/test_popart/test_training_dropout_default_popart.cc new file mode 100644 index 000000000..9a27bf14a --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_training_dropout_default_popart.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_default_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_default/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_default/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_training_dropout_default | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_default_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_training_dropout_mask_popart.cc b/tests/unittests/lit_cases/test_popart/test_training_dropout_mask_popart.cc new file mode 100644 index 000000000..238eafb67 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_training_dropout_mask_popart.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_mask_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_mask/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_training_dropout_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_mask_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_training_dropout_popart.cc b/tests/unittests/lit_cases/test_popart/test_training_dropout_popart.cc new file mode 100644 index 000000000..723df7461 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_training_dropout_popart.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_training_dropout | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_training_dropout_zero_ratio_mask_popart.cc b/tests/unittests/lit_cases/test_popart/test_training_dropout_zero_ratio_mask_popart.cc new file mode 100644 index 000000000..7c9e3829e --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_training_dropout_zero_ratio_mask_popart.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_zero_ratio_mask_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_zero_ratio_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_zero_ratio_mask/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_training_dropout_zero_ratio_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_zero_ratio_mask_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_training_dropout_zero_ratio_popart.cc b/tests/unittests/lit_cases/test_popart/test_training_dropout_zero_ratio_popart.cc new file mode 100644 index 000000000..db50eca24 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_training_dropout_zero_ratio_popart.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_zero_ratio_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_zero_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_zero_ratio/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_training_dropout_zero_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_zero_ratio_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unique_not_sorted_without_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_unique_not_sorted_without_axis_popart.cc new file mode 100644 index 000000000..7df26d39d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unique_not_sorted_without_axis_popart.cc @@ -0,0 +1,32 @@ +//===-test_unique_not_sorted_without_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_not_sorted_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_not_sorted_without_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unique_not_sorted_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_not_sorted_without_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unique_sorted_with_axis_3d_popart.cc b/tests/unittests/lit_cases/test_popart/test_unique_sorted_with_axis_3d_popart.cc new file mode 100644 index 000000000..a9e166ee4 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unique_sorted_with_axis_3d_popart.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_axis_3d_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_axis_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_axis_3d/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unique_sorted_with_axis_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_axis_3d_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unique_sorted_with_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_unique_sorted_with_axis_popart.cc new file mode 100644 index 000000000..e38df42dd --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unique_sorted_with_axis_popart.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unique_sorted_with_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unique_sorted_with_negative_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_unique_sorted_with_negative_axis_popart.cc new file mode 100644 index 000000000..863b93c2d --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unique_sorted_with_negative_axis_popart.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_negative_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_negative_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unique_sorted_with_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_negative_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unique_sorted_without_axis_popart.cc b/tests/unittests/lit_cases/test_popart/test_unique_sorted_without_axis_popart.cc new file mode 100644 index 000000000..d9bd1144c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unique_sorted_without_axis_popart.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_without_axis_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_without_axis/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unique_sorted_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_without_axis_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_0_popart.cc b/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_0_popart.cc new file mode 100644 index 000000000..ff6b83845 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_0_popart.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_0_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_0/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unsqueeze_axis_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_0_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_1_popart.cc b/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_1_popart.cc new file mode 100644 index 000000000..4059af518 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_1_popart.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_1_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_1/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unsqueeze_axis_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_1_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_2_popart.cc b/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_2_popart.cc new file mode 100644 index 000000000..8485f9b75 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_2_popart.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_2_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_2/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unsqueeze_axis_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_2_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_3_popart.cc b/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_3_popart.cc new file mode 100644 index 000000000..83c84a405 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unsqueeze_axis_3_popart.cc @@ -0,0 +1,29 @@ +//===-test_unsqueeze_axis_3_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_3/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unsqueeze_axis_3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_3_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unsqueeze_negative_axes_popart.cc b/tests/unittests/lit_cases/test_popart/test_unsqueeze_negative_axes_popart.cc new file mode 100644 index 000000000..00d6df9be --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unsqueeze_negative_axes_popart.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_negative_axes_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_negative_axes/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unsqueeze_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_negative_axes_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unsqueeze_three_axes_popart.cc b/tests/unittests/lit_cases/test_popart/test_unsqueeze_three_axes_popart.cc new file mode 100644 index 000000000..6f821a8e7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unsqueeze_three_axes_popart.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_three_axes_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_three_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_three_axes/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unsqueeze_three_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_three_axes_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unsqueeze_two_axes_popart.cc b/tests/unittests/lit_cases/test_popart/test_unsqueeze_two_axes_popart.cc new file mode 100644 index 000000000..b26ecb05c --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unsqueeze_two_axes_popart.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_two_axes_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_two_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_two_axes/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unsqueeze_two_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_two_axes_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_unsqueeze_unsorted_axes_popart.cc b/tests/unittests/lit_cases/test_popart/test_unsqueeze_unsorted_axes_popart.cc new file mode 100644 index 000000000..6be15fb09 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_unsqueeze_unsorted_axes_popart.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_unsorted_axes_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_unsorted_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_unsorted_axes/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_unsqueeze_unsorted_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_unsorted_axes_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_popart/test_where_long_example_popart.cc b/tests/unittests/lit_cases/test_popart/test_where_long_example_popart.cc new file mode 100644 index 000000000..df4275cf7 --- /dev/null +++ b/tests/unittests/lit_cases/test_popart/test_where_long_example_popart.cc @@ -0,0 +1,31 @@ +//===-test_where_long_example_popart.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on popart +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_where_long_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_where_long_example/test_data_set_0 %odla_link %device_link -lodla_popart -o %t_popart.exe -Wno-deprecated-declarations +// RUN: %t_popart.exe 0.0001 0 popart %data_path/test_where_long_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_where_long_example_popart.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_adagrad_multiple_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_adagrad_multiple_tensorrt.cc new file mode 100644 index 000000000..e3e62fda1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_adagrad_multiple_tensorrt.cc @@ -0,0 +1,39 @@ +//===-test_adagrad_multiple_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adagrad_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adagrad_multiple/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_adagrad_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adagrad_multiple_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_adagrad_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_adagrad_tensorrt.cc new file mode 100644 index 000000000..4fe4fef06 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_adagrad_tensorrt.cc @@ -0,0 +1,34 @@ +//===-test_adagrad_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adagrad/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adagrad/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_adagrad | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adagrad_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_adam_multiple_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_adam_multiple_tensorrt.cc new file mode 100644 index 000000000..c781b2ed1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_adam_multiple_tensorrt.cc @@ -0,0 +1,43 @@ +//===-test_adam_multiple_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_4.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_8.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_8.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_9.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_9.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_5.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_5.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adam_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adam_multiple/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_adam_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adam_multiple_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_adam_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_adam_tensorrt.cc new file mode 100644 index 000000000..b172533f1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_adam_tensorrt.cc @@ -0,0 +1,36 @@ +//===-test_adam_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adam/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adam/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_adam | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adam_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmax_default_axis_example_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmax_default_axis_example_select_last_index_tensorrt.cc new file mode 100644 index 000000000..ba2fa2622 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmax_default_axis_example_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmax_default_axis_example_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_default_axis_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmax_default_axis_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_default_axis_example_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmax_default_axis_random_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmax_default_axis_random_select_last_index_tensorrt.cc new file mode 100644 index 000000000..22ccebc27 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmax_default_axis_random_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmax_default_axis_random_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_default_axis_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmax_default_axis_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_default_axis_random_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmax_keepdims_example_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmax_keepdims_example_select_last_index_tensorrt.cc new file mode 100644 index 000000000..b47ee382b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmax_keepdims_example_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmax_keepdims_example_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmax_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_keepdims_example_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmax_keepdims_random_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmax_keepdims_random_select_last_index_tensorrt.cc new file mode 100644 index 000000000..b145db1bc --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmax_keepdims_random_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmax_keepdims_random_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmax_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_keepdims_random_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_example_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_example_select_last_index_tensorrt.cc new file mode 100644 index 000000000..f30084645 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_example_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_example_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmax_negative_axis_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_example_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_example_tensorrt.cc new file mode 100644 index 000000000..e7c0dfaa4 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmax_negative_axis_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_random_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_random_select_last_index_tensorrt.cc new file mode 100644 index 000000000..6c307feaa --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_random_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_random_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmax_negative_axis_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_random_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_random_tensorrt.cc new file mode 100644 index 000000000..8c771f4c4 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmax_negative_axis_keepdims_random_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmax_negative_axis_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmax_no_keepdims_example_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmax_no_keepdims_example_select_last_index_tensorrt.cc new file mode 100644 index 000000000..f9ae9816e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmax_no_keepdims_example_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmax_no_keepdims_example_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_no_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmax_no_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_no_keepdims_example_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmax_no_keepdims_random_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmax_no_keepdims_random_select_last_index_tensorrt.cc new file mode 100644 index 000000000..7195ad049 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmax_no_keepdims_random_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmax_no_keepdims_random_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_no_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmax_no_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_no_keepdims_random_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmin_default_axis_example_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmin_default_axis_example_select_last_index_tensorrt.cc new file mode 100644 index 000000000..c27219a1c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmin_default_axis_example_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmin_default_axis_example_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_default_axis_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmin_default_axis_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_default_axis_example_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmin_default_axis_random_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmin_default_axis_random_select_last_index_tensorrt.cc new file mode 100644 index 000000000..bbf5693c6 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmin_default_axis_random_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmin_default_axis_random_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_default_axis_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmin_default_axis_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_default_axis_random_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmin_keepdims_example_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmin_keepdims_example_select_last_index_tensorrt.cc new file mode 100644 index 000000000..b8d9f18b1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmin_keepdims_example_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmin_keepdims_example_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmin_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_keepdims_example_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmin_keepdims_random_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmin_keepdims_random_select_last_index_tensorrt.cc new file mode 100644 index 000000000..4926a53f1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmin_keepdims_random_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmin_keepdims_random_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmin_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_keepdims_random_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_example_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_example_select_last_index_tensorrt.cc new file mode 100644 index 000000000..a37103fe3 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_example_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_example_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmin_negative_axis_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_example_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_example_tensorrt.cc new file mode 100644 index 000000000..764cb494f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmin_negative_axis_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_random_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_random_select_last_index_tensorrt.cc new file mode 100644 index 000000000..b377f935d --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_random_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_random_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmin_negative_axis_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_random_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_random_tensorrt.cc new file mode 100644 index 000000000..da7faeea2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmin_negative_axis_keepdims_random_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmin_negative_axis_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmin_no_keepdims_example_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmin_no_keepdims_example_select_last_index_tensorrt.cc new file mode 100644 index 000000000..995aece80 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmin_no_keepdims_example_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmin_no_keepdims_example_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_no_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmin_no_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_no_keepdims_example_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_argmin_no_keepdims_random_select_last_index_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_argmin_no_keepdims_random_select_last_index_tensorrt.cc new file mode 100644 index 000000000..6ddefbeb2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_argmin_no_keepdims_random_select_last_index_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_argmin_no_keepdims_random_select_last_index_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_no_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_argmin_no_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_no_keepdims_random_select_last_index_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint16_tensorrt.cc new file mode 100644 index 000000000..a81a48bb0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_bitshift_left_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint32_tensorrt.cc new file mode 100644 index 000000000..967cfd48b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_bitshift_left_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint64_tensorrt.cc new file mode 100644 index 000000000..d75e80010 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_bitshift_left_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint8_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint8_tensorrt.cc new file mode 100644 index 000000000..09d38dee2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_left_uint8_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint8_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint8/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_bitshift_left_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint8_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint16_tensorrt.cc new file mode 100644 index 000000000..440a1d0ff --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_bitshift_right_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint32_tensorrt.cc new file mode 100644 index 000000000..3f4404c0b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_bitshift_right_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint64_tensorrt.cc new file mode 100644 index 000000000..b23f92555 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_bitshift_right_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint8_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint8_tensorrt.cc new file mode 100644 index 000000000..0503c2a1a --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_bitshift_right_uint8_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint8_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint8/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_bitshift_right_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint8_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_cast_BFLOAT16_to_FLOAT_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_cast_BFLOAT16_to_FLOAT_tensorrt.cc new file mode 100644 index 000000000..701bd1bcc --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_cast_BFLOAT16_to_FLOAT_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_cast_BFLOAT16_to_FLOAT_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cast_BFLOAT16_to_FLOAT/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_cast_BFLOAT16_to_FLOAT | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cast_BFLOAT16_to_FLOAT_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_cast_FLOAT_to_BFLOAT16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_cast_FLOAT_to_BFLOAT16_tensorrt.cc new file mode 100644 index 000000000..e6e23e221 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_cast_FLOAT_to_BFLOAT16_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_cast_FLOAT_to_BFLOAT16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cast_FLOAT_to_BFLOAT16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_cast_FLOAT_to_BFLOAT16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cast_FLOAT_to_BFLOAT16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_celu_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_celu_expanded_tensorrt.cc new file mode 100644 index 000000000..ac6dec2f8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_celu_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_celu_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_celu_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_celu_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_celu_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_celu_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_celu_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_celu_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_celu_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_celu_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_celu_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_celu_tensorrt.cc new file mode 100644 index 000000000..9a27bca9f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_celu_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_celu_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_celu/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_celu/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_celu/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_celu/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_celu/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_celu/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_celu | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_celu_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_inbounds_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_inbounds_tensorrt.cc new file mode 100644 index 000000000..f7a4225a0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_inbounds_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_clip_default_int8_inbounds_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_inbounds/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_inbounds/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_inbounds/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_inbounds/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_inbounds/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_inbounds/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_clip_default_int8_inbounds | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_inbounds_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_max_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_max_tensorrt.cc new file mode 100644 index 000000000..8ab01fc4f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_max_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_clip_default_int8_max_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_max/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_max/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_clip_default_int8_max | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_max_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_min_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_min_tensorrt.cc new file mode 100644 index 000000000..7de882044 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_clip_default_int8_min_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_clip_default_int8_min_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_min/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_min/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_clip_default_int8_min | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_min_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_compress_negative_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_compress_negative_axis_tensorrt.cc new file mode 100644 index 000000000..ffe5b4626 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_compress_negative_axis_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_compress_negative_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_compress_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_compress_negative_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_compress_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_compress_negative_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_concat_1d_axis_negative_1_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_concat_1d_axis_negative_1_tensorrt.cc new file mode 100644 index 000000000..82a3f0634 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_concat_1d_axis_negative_1_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_concat_1d_axis_negative_1_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_1d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_1d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_concat_1d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_1d_axis_negative_1_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_concat_2d_axis_negative_1_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_concat_2d_axis_negative_1_tensorrt.cc new file mode 100644 index 000000000..a2463cfab --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_concat_2d_axis_negative_1_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_concat_2d_axis_negative_1_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_2d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_2d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_concat_2d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_2d_axis_negative_1_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_concat_2d_axis_negative_2_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_concat_2d_axis_negative_2_tensorrt.cc new file mode 100644 index 000000000..f69774cfb --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_concat_2d_axis_negative_2_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_concat_2d_axis_negative_2_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_2d_axis_negative_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_2d_axis_negative_2/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_concat_2d_axis_negative_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_2d_axis_negative_2_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_1_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_1_tensorrt.cc new file mode 100644 index 000000000..a92033704 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_1_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_1_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_concat_3d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_1_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_2_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_2_tensorrt.cc new file mode 100644 index 000000000..8919444d9 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_2_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_2_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_2/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_concat_3d_axis_negative_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_2_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_3_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_3_tensorrt.cc new file mode 100644 index 000000000..08c2f26af --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_concat_3d_axis_negative_3_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_3_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_3/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_concat_3d_axis_negative_3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_3_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_constantofshape_int_shape_zero_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_constantofshape_int_shape_zero_tensorrt.cc new file mode 100644 index 000000000..9f58c17c0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_constantofshape_int_shape_zero_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_constantofshape_int_shape_zero_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_constantofshape_int_shape_zero/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_constantofshape_int_shape_zero/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_constantofshape_int_shape_zero/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_constantofshape_int_shape_zero/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_constantofshape_int_shape_zero/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_constantofshape_int_shape_zero/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_constantofshape_int_shape_zero | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_constantofshape_int_shape_zero_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_exclusive_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_exclusive_tensorrt.cc new file mode 100644 index 000000000..9d07e5226 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_exclusive_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_exclusive_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_exclusive/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_exclusive/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_cumsum_1d_exclusive | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_exclusive_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_reverse_exclusive_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_reverse_exclusive_tensorrt.cc new file mode 100644 index 000000000..a184fef7f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_reverse_exclusive_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_reverse_exclusive_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_reverse_exclusive/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_cumsum_1d_reverse_exclusive | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_reverse_exclusive_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_reverse_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_reverse_tensorrt.cc new file mode 100644 index 000000000..9027796d3 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_reverse_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_reverse_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_reverse/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_reverse/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_cumsum_1d_reverse | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_reverse_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_tensorrt.cc new file mode 100644 index 000000000..3e95d649b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_1d_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_cumsum_1d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_axis_0_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_axis_0_tensorrt.cc new file mode 100644 index 000000000..3c976e014 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_axis_0_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_axis_0_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_axis_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_axis_0/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_cumsum_2d_axis_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_axis_0_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_axis_1_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_axis_1_tensorrt.cc new file mode 100644 index 000000000..1d207407b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_axis_1_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_axis_1_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_axis_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_axis_1/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_cumsum_2d_axis_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_axis_1_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_negative_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_negative_axis_tensorrt.cc new file mode 100644 index 000000000..7362f02aa --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_cumsum_2d_negative_axis_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_negative_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_negative_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_cumsum_2d_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_negative_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_depthtospace_crd_mode_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_depthtospace_crd_mode_example_tensorrt.cc new file mode 100644 index 000000000..fd3c1c7fc --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_depthtospace_crd_mode_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_crd_mode_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_crd_mode_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_crd_mode_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_depthtospace_crd_mode_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_crd_mode_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_depthtospace_crd_mode_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_depthtospace_crd_mode_tensorrt.cc new file mode 100644 index 000000000..9d27efd91 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_depthtospace_crd_mode_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_crd_mode_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_crd_mode/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_crd_mode/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_depthtospace_crd_mode | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_crd_mode_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_depthtospace_dcr_mode_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_depthtospace_dcr_mode_tensorrt.cc new file mode 100644 index 000000000..1c55044f7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_depthtospace_dcr_mode_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_dcr_mode_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_dcr_mode/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_dcr_mode/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_dcr_mode/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_dcr_mode/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_dcr_mode/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_dcr_mode/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_depthtospace_dcr_mode | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_dcr_mode_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dequantizelinear_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dequantizelinear_axis_tensorrt.cc new file mode 100644 index 000000000..c15863394 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dequantizelinear_axis_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_dequantizelinear_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dequantizelinear_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dequantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dequantizelinear_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dequantizelinear_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_det_2d_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_det_2d_tensorrt.cc new file mode 100644 index 000000000..2f028245c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_det_2d_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_det_2d_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_det_2d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_det_2d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_det_2d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_det_2d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_det_2d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_det_2d/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_det_2d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_det_2d_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_det_nd_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_det_nd_tensorrt.cc new file mode 100644 index 000000000..80ee72d46 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_det_nd_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_det_nd_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_det_nd/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_det_nd/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_det_nd/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_det_nd/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_det_nd/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_det_nd/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_det_nd | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_det_nd_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_mask_ratio_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_mask_ratio_tensorrt.cc new file mode 100644 index 000000000..c3e923fd1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_mask_ratio_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_dropout_default_mask_ratio_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_mask_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_mask_ratio/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dropout_default_mask_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_mask_ratio_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_mask_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_mask_tensorrt.cc new file mode 100644 index 000000000..c776d861c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_mask_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_dropout_default_mask_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_mask/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dropout_default_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_mask_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_old_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_old_tensorrt.cc new file mode 100644 index 000000000..216ba998c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_old_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_dropout_default_old_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_old/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_old/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_old/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_old/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_old/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_old/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dropout_default_old | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_old_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_ratio_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_ratio_tensorrt.cc new file mode 100644 index 000000000..795b5be87 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dropout_default_ratio_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_dropout_default_ratio_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_ratio/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dropout_default_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_ratio_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dropout_random_old_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dropout_random_old_tensorrt.cc new file mode 100644 index 000000000..9baaa1941 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dropout_random_old_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_dropout_random_old_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_random_old/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_random_old/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_random_old/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_random_old/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_random_old/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_random_old/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dropout_random_old | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_random_old_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_expanded_tensorrt.cc new file mode 100644 index 000000000..f1c209e67 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dynamicquantizelinear_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_max_adjusted_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_max_adjusted_expanded_tensorrt.cc new file mode 100644 index 000000000..f32dc910f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_max_adjusted_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_max_adjusted_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_max_adjusted_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dynamicquantizelinear_max_adjusted_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_max_adjusted_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_max_adjusted_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_max_adjusted_tensorrt.cc new file mode 100644 index 000000000..a5392a382 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_max_adjusted_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_max_adjusted_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_max_adjusted/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dynamicquantizelinear_max_adjusted | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_max_adjusted_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_min_adjusted_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_min_adjusted_expanded_tensorrt.cc new file mode 100644 index 000000000..cfb4a66d0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_min_adjusted_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_min_adjusted_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_min_adjusted_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dynamicquantizelinear_min_adjusted_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_min_adjusted_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_min_adjusted_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_min_adjusted_tensorrt.cc new file mode 100644 index 000000000..b59c00734 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_min_adjusted_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_min_adjusted_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_min_adjusted/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dynamicquantizelinear_min_adjusted | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_min_adjusted_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_tensorrt.cc new file mode 100644 index 000000000..c85a6fd9d --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_dynamicquantizelinear_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_dynamicquantizelinear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_einsum_batch_diagonal_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_einsum_batch_diagonal_tensorrt.cc new file mode 100644 index 000000000..a02b650b8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_einsum_batch_diagonal_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_einsum_batch_diagonal_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_diagonal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_diagonal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_diagonal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_diagonal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_batch_diagonal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_batch_diagonal/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_einsum_batch_diagonal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_batch_diagonal_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_einsum_batch_matmul_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_einsum_batch_matmul_tensorrt.cc new file mode 100644 index 000000000..7e395172b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_einsum_batch_matmul_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_einsum_batch_matmul_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_batch_matmul/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_batch_matmul/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_einsum_batch_matmul | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_batch_matmul_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_einsum_inner_prod_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_einsum_inner_prod_tensorrt.cc new file mode 100644 index 000000000..45f29783f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_einsum_inner_prod_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_einsum_inner_prod_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_inner_prod/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_inner_prod/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_einsum_inner_prod | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_inner_prod_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_einsum_sum_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_einsum_sum_tensorrt.cc new file mode 100644 index 000000000..7a889b86f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_einsum_sum_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_einsum_sum_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_sum/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_einsum_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_sum_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_einsum_transpose_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_einsum_transpose_tensorrt.cc new file mode 100644 index 000000000..19ffb9bd3 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_einsum_transpose_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_einsum_transpose_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_transpose/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_transpose/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_transpose/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_transpose/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_transpose/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_transpose/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_einsum_transpose | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_transpose_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis1_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis1_tensorrt.cc new file mode 100644 index 000000000..d8f5b6bd8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis1_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis1_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis1/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_flatten_negative_axis1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis1_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis2_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis2_tensorrt.cc new file mode 100644 index 000000000..8e4248f50 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis2_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis2_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis2/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_flatten_negative_axis2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis2_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis3_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis3_tensorrt.cc new file mode 100644 index 000000000..e8c18aca9 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis3_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis3_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis3/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_flatten_negative_axis3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis3_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis4_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis4_tensorrt.cc new file mode 100644 index 000000000..d531c3786 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_flatten_negative_axis4_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis4_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis4/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis4/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis4/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis4/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis4/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis4/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_flatten_negative_axis4 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis4_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gather_2d_indices_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gather_2d_indices_tensorrt.cc new file mode 100644 index 000000000..31cf5439d --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gather_2d_indices_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_gather_2d_indices_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_2d_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_2d_indices/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gather_2d_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_2d_indices_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gather_elements_0_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gather_elements_0_tensorrt.cc new file mode 100644 index 000000000..624c97fce --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gather_elements_0_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_0_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_0/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gather_elements_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_0_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gather_elements_1_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gather_elements_1_tensorrt.cc new file mode 100644 index 000000000..0a3433001 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gather_elements_1_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_1_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_1/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gather_elements_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_1_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gather_elements_negative_indices_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gather_elements_negative_indices_tensorrt.cc new file mode 100644 index 000000000..7ce53b619 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gather_elements_negative_indices_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_negative_indices_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_negative_indices/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gather_elements_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_negative_indices_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gather_negative_indices_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gather_negative_indices_tensorrt.cc new file mode 100644 index 000000000..94651ca7c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gather_negative_indices_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_gather_negative_indices_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_negative_indices/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gather_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_negative_indices_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_float32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_float32_tensorrt.cc new file mode 100644 index 000000000..4802fe663 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_float32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_float32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_float32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gathernd_example_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_float32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_int32_batch_dim1_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_int32_batch_dim1_tensorrt.cc new file mode 100644 index 000000000..f0ad5aea7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_int32_batch_dim1_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_int32_batch_dim1_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_int32_batch_dim1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gathernd_example_int32_batch_dim1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_int32_batch_dim1_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_int32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_int32_tensorrt.cc new file mode 100644 index 000000000..e6efa7c6e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gathernd_example_int32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_int32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_int32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gathernd_example_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_int32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_all_attributes_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_all_attributes_tensorrt.cc new file mode 100644 index 000000000..ed3a37292 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_all_attributes_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_gemm_all_attributes_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_all_attributes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_all_attributes/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_all_attributes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_all_attributes_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_alpha_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_alpha_tensorrt.cc new file mode 100644 index 000000000..e3b1ad25c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_alpha_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_gemm_alpha_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_alpha/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_alpha/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_alpha | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_alpha_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_beta_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_beta_tensorrt.cc new file mode 100644 index 000000000..71acad847 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_beta_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_gemm_beta_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_beta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_beta/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_beta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_beta_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_matrix_bias_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_matrix_bias_tensorrt.cc new file mode 100644 index 000000000..204c9ec79 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_matrix_bias_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_matrix_bias_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_matrix_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_matrix_bias/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_default_matrix_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_matrix_bias_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_no_bias_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_no_bias_tensorrt.cc new file mode 100644 index 000000000..936d28af7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_no_bias_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_gemm_default_no_bias_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_no_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_no_bias/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_default_no_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_no_bias_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_scalar_bias_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_scalar_bias_tensorrt.cc new file mode 100644 index 000000000..bdc6a08eb --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_scalar_bias_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_scalar_bias_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_scalar_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_scalar_bias/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_default_scalar_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_scalar_bias_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_single_elem_vector_bias_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_single_elem_vector_bias_tensorrt.cc new file mode 100644 index 000000000..837f02811 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_single_elem_vector_bias_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_single_elem_vector_bias_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_single_elem_vector_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_default_single_elem_vector_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_single_elem_vector_bias_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_vector_bias_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_vector_bias_tensorrt.cc new file mode 100644 index 000000000..a2317daf2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_vector_bias_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_vector_bias_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_vector_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_vector_bias/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_default_vector_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_vector_bias_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_zero_bias_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_zero_bias_tensorrt.cc new file mode 100644 index 000000000..6c3897cc0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_default_zero_bias_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_zero_bias_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_zero_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_zero_bias/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_default_zero_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_zero_bias_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_transposeA_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_transposeA_tensorrt.cc new file mode 100644 index 000000000..2bed6674b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_transposeA_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_gemm_transposeA_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_transposeA/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_transposeA/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_transposeA | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_transposeA_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_gemm_transposeB_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_gemm_transposeB_tensorrt.cc new file mode 100644 index 000000000..2223cf020 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_gemm_transposeB_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_gemm_transposeB_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_transposeB/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_transposeB/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_gemm_transposeB | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_transposeB_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_bcast_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_bcast_expanded_tensorrt.cc new file mode 100644 index 000000000..d896cd131 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_bcast_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_bcast_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_bcast_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_bcast_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_greater_equal_bcast_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_bcast_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_bcast_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_bcast_tensorrt.cc new file mode 100644 index 000000000..456b975d7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_bcast_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_bcast_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_bcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_bcast/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_greater_equal_bcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_bcast_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_expanded_tensorrt.cc new file mode 100644 index 000000000..c954eea0b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_greater_equal_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_tensorrt.cc new file mode 100644 index 000000000..2eaa0c37f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_greater_equal_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_greater_equal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_hardmax_negative_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_hardmax_negative_axis_tensorrt.cc new file mode 100644 index 000000000..68a3a9949 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_hardmax_negative_axis_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_hardmax_negative_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_hardmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_hardmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_hardmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_hardmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_hardmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_hardmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_hardmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_hardmax_negative_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_if_seq_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_if_seq_tensorrt.cc new file mode 100644 index 000000000..c075c6e61 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_if_seq_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_if_seq_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_if_seq/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_if_seq/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_if_seq/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_if_seq/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_if_seq/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_if_seq/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_if_seq | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_if_seq_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_if_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_if_tensorrt.cc new file mode 100644 index 000000000..fe06a1a57 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_if_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_if_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_if/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_if/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_if/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_if/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_if/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_if/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_if | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_if_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_less_equal_bcast_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_less_equal_bcast_expanded_tensorrt.cc new file mode 100644 index 000000000..585ea06d2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_less_equal_bcast_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_bcast_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_bcast_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_bcast_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_less_equal_bcast_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_bcast_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_less_equal_bcast_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_less_equal_bcast_tensorrt.cc new file mode 100644 index 000000000..945a8158b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_less_equal_bcast_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_bcast_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_bcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_bcast/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_less_equal_bcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_bcast_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_less_equal_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_less_equal_expanded_tensorrt.cc new file mode 100644 index 000000000..fe1819780 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_less_equal_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_less_equal_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_less_equal_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_less_equal_tensorrt.cc new file mode 100644 index 000000000..8467de87a --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_less_equal_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_less_equal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_0_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_0_expanded_tensorrt.cc new file mode 100644 index 000000000..7e964f9d5 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_0_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_0_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_0_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_0_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_logsoftmax_axis_0_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_0_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_1_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_1_expanded_tensorrt.cc new file mode 100644 index 000000000..d9ef79f9b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_1_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_1_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_1_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_logsoftmax_axis_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_1_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_2_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_2_expanded_tensorrt.cc new file mode 100644 index 000000000..5f88d6d2e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_axis_2_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_2_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_2_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_logsoftmax_axis_2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_2_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_default_axis_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_default_axis_expanded_tensorrt.cc new file mode 100644 index 000000000..02a43a9b2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_default_axis_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_default_axis_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_default_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_default_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_logsoftmax_default_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_default_axis_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_example_1_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_example_1_expanded_tensorrt.cc new file mode 100644 index 000000000..74a4a9c4d --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_example_1_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_example_1_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_example_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_example_1_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_logsoftmax_example_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_example_1_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_large_number_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_large_number_expanded_tensorrt.cc new file mode 100644 index 000000000..daea423a1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_large_number_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_large_number_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_large_number_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_large_number_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_logsoftmax_large_number_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_large_number_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_negative_axis_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_negative_axis_expanded_tensorrt.cc new file mode 100644 index 000000000..af4cbeb66 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_negative_axis_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_negative_axis_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_negative_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_logsoftmax_negative_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_negative_axis_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_negative_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_negative_axis_tensorrt.cc new file mode 100644 index 000000000..0b97d1315 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_logsoftmax_negative_axis_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_negative_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_logsoftmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_negative_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_loop11_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_loop11_tensorrt.cc new file mode 100644 index 000000000..bfdbdb436 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_loop11_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_loop11_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_loop11/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_loop11/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_loop11 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_loop11_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_loop13_seq_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_loop13_seq_tensorrt.cc new file mode 100644 index 000000000..d044d54b4 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_loop13_seq_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_loop13_seq_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_loop13_seq/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_loop13_seq/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_loop13_seq | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_loop13_seq_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_float16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_float16_tensorrt.cc new file mode 100644 index 000000000..c8287f4f0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_float16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_float16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_float32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_float32_tensorrt.cc new file mode 100644 index 000000000..f90e1f40f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_float32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_float32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_float64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_float64_tensorrt.cc new file mode 100644 index 000000000..3d1a9dc79 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_float64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_float64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_int16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_int16_tensorrt.cc new file mode 100644 index 000000000..03c20112d --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_int16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_int16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_int32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_int32_tensorrt.cc new file mode 100644 index 000000000..2818793bc --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_int32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_int32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_int64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_int64_tensorrt.cc new file mode 100644 index 000000000..a82a7458e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_int64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_int64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_int8_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_int8_tensorrt.cc new file mode 100644 index 000000000..c979d04d7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_int8_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_int8_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int8/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int8_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_uint16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_uint16_tensorrt.cc new file mode 100644 index 000000000..337078df5 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_uint16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_uint16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_uint32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_uint32_tensorrt.cc new file mode 100644 index 000000000..882227318 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_uint32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_uint32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_uint64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_uint64_tensorrt.cc new file mode 100644 index 000000000..226e0c1f6 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_uint64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_uint64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_max_uint8_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_max_uint8_tensorrt.cc new file mode 100644 index 000000000..642dc4bef --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_max_uint8_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_max_uint8_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint8/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_max_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint8_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_maxpool_2d_uint8_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_maxpool_2d_uint8_tensorrt.cc new file mode 100644 index 000000000..2e471b931 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_maxpool_2d_uint8_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_maxpool_2d_uint8_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_maxpool_2d_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_maxpool_2d_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_maxpool_2d_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_maxpool_2d_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_maxpool_2d_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_maxpool_2d_uint8/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_maxpool_2d_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_maxpool_2d_uint8_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_float16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_float16_tensorrt.cc new file mode 100644 index 000000000..f17141390 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_float16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_float16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_float32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_float32_tensorrt.cc new file mode 100644 index 000000000..da30b568b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_float32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_float32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_float64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_float64_tensorrt.cc new file mode 100644 index 000000000..9fbf2d984 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_float64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_float64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_int16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_int16_tensorrt.cc new file mode 100644 index 000000000..659f87222 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_int16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_int16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_int32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_int32_tensorrt.cc new file mode 100644 index 000000000..62fa70767 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_int32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_int32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_int64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_int64_tensorrt.cc new file mode 100644 index 000000000..752437d0f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_int64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_int64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_int8_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_int8_tensorrt.cc new file mode 100644 index 000000000..e954c7039 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_int8_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_int8_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int8/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int8_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_uint16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_uint16_tensorrt.cc new file mode 100644 index 000000000..b59530e2d --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_uint16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_uint16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_uint32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_uint32_tensorrt.cc new file mode 100644 index 000000000..ce4cff32f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_uint32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_uint32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_uint64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_uint64_tensorrt.cc new file mode 100644 index 000000000..ae28484aa --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_uint64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_uint64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_min_uint8_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_min_uint8_tensorrt.cc new file mode 100644 index 000000000..c1f17083d --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_min_uint8_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_min_uint8_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint8/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_min_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint8_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_broadcast_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_broadcast_tensorrt.cc new file mode 100644 index 000000000..db909358b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_broadcast_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_broadcast_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_broadcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_broadcast/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_broadcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_broadcast_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_int64_fmod_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_int64_fmod_tensorrt.cc new file mode 100644 index 000000000..880737dd5 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_int64_fmod_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_int64_fmod_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_int64_fmod/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_int64_fmod/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_int64_fmod | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_int64_fmod_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float16_tensorrt.cc new file mode 100644 index 000000000..1cec1037a --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_mixed_sign_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float32_tensorrt.cc new file mode 100644 index 000000000..acb21a092 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_mixed_sign_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float64_tensorrt.cc new file mode 100644 index 000000000..12654c136 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_float64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_mixed_sign_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int16_tensorrt.cc new file mode 100644 index 000000000..12539d3b7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_mixed_sign_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int32_tensorrt.cc new file mode 100644 index 000000000..e103d8cb1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_mixed_sign_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int64_tensorrt.cc new file mode 100644 index 000000000..42f843763 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_mixed_sign_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int8_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int8_tensorrt.cc new file mode 100644 index 000000000..1085efb69 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_mixed_sign_int8_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int8_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int8/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_mixed_sign_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int8_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_uint16_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_uint16_tensorrt.cc new file mode 100644 index 000000000..ce9711933 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_uint16_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint16_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint16/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint16_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_uint32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_uint32_tensorrt.cc new file mode 100644 index 000000000..7ad1e94b8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_uint32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_uint64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_uint64_tensorrt.cc new file mode 100644 index 000000000..62fd18385 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_uint64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_mod_uint8_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_mod_uint8_tensorrt.cc new file mode 100644 index 000000000..116d6401b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_mod_uint8_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint8_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint8/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_mod_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint8_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_momentum_multiple_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_momentum_multiple_tensorrt.cc new file mode 100644 index 000000000..8dca78dcc --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_momentum_multiple_tensorrt.cc @@ -0,0 +1,39 @@ +//===-test_momentum_multiple_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_momentum_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_momentum_multiple/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_momentum_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_momentum_multiple_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_momentum_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_momentum_tensorrt.cc new file mode 100644 index 000000000..4a7c1df4c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_momentum_tensorrt.cc @@ -0,0 +1,34 @@ +//===-test_momentum_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_momentum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_momentum/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_momentum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_momentum_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nesterov_momentum_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nesterov_momentum_tensorrt.cc new file mode 100644 index 000000000..f34ea2196 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nesterov_momentum_tensorrt.cc @@ -0,0 +1,34 @@ +//===-test_nesterov_momentum_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nesterov_momentum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nesterov_momentum/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nesterov_momentum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nesterov_momentum_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NC_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NC_expanded_tensorrt.cc new file mode 100644 index 000000000..75da90350 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NC_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NC_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NC_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NC_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NC_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NC_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NC_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NC_tensorrt.cc new file mode 100644 index 000000000..ae68ec406 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NC_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NC_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NC/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NC/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NC | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NC_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_expanded_tensorrt.cc new file mode 100644 index 000000000..0abb87085 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..255f11326 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_ii_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_ii_tensorrt.cc new file mode 100644 index 000000000..70e54cad7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_ii_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..398aef1d8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_mean_weight_negative_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_mean_weight_negative_ii_tensorrt.cc new file mode 100644 index 000000000..6b33c5e58 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_mean_weight_negative_ii_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_mean_weight_negative_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_mean_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1_mean_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_mean_weight_negative_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_tensorrt.cc new file mode 100644 index 000000000..fb429506f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_expanded_tensorrt.cc new file mode 100644 index 000000000..6b76f0dc9 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..5843124bb --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_ii_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_ii_tensorrt.cc new file mode 100644 index 000000000..85f04d6f7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_ii_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_tensorrt.cc new file mode 100644 index 000000000..7d5e761b5 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1_weight_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_expanded_tensorrt.cc new file mode 100644 index 000000000..f9c69e43c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..18b42c297 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_tensorrt.cc new file mode 100644 index 000000000..0aa4eef21 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_no_weight_reduction_mean_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_no_weight_reduction_mean_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_mean_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_mean_expanded_tensorrt.cc new file mode 100644 index 000000000..d550eba21 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_mean_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_mean_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_reduction_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_mean_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_mean_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_mean_tensorrt.cc new file mode 100644 index 000000000..92d21d466 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_mean_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_mean_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_reduction_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_mean_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_sum_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_sum_expanded_tensorrt.cc new file mode 100644 index 000000000..8efecedc6 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_sum_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_sum_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_reduction_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_sum_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_sum_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_sum_tensorrt.cc new file mode 100644 index 000000000..8b4fd5966 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_reduction_sum_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_sum_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_reduction_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_sum_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_tensorrt.cc new file mode 100644 index 000000000..3a93c6235 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_expanded_tensorrt.cc new file mode 100644 index 000000000..25419c4d8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_with_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_tensorrt.cc new file mode 100644 index 000000000..e4da6c1c2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_mean_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_mean_tensorrt.cc new file mode 100644 index 000000000..76b6470de --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_mean_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_mean_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_mean_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_tensorrt.cc new file mode 100644 index 000000000..ae5367742 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..d1d2e3699 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_tensorrt.cc new file mode 100644 index 000000000..1e5eb7651 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_tensorrt.cc new file mode 100644 index 000000000..82390d18e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_reduction_sum_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_tensorrt.cc new file mode 100644 index 000000000..ea04ec8ee --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2_with_weight_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2_with_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..3a5f06e97 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc new file mode 100644 index 000000000..fb483e7f7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..5ad812c16 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_sum_weight_high_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_sum_weight_high_ii_tensorrt.cc new file mode 100644 index 000000000..224401a3f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3_sum_weight_high_ii_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3_sum_weight_high_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_sum_weight_high_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc new file mode 100644 index 000000000..81527c671 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_mean_weight_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_mean_weight_tensorrt.cc new file mode 100644 index 000000000..57da6a145 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_mean_weight_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3d4d5_mean_weight_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_mean_weight_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc new file mode 100644 index 000000000..e6ec4c688 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_none_no_weight_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_none_no_weight_tensorrt.cc new file mode 100644 index 000000000..c8c188883 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_nllloss_NCd1d2d3d4d5_none_no_weight_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3d4d5_none_no_weight_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_none_no_weight_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_onehot_negative_indices_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_onehot_negative_indices_tensorrt.cc new file mode 100644 index 000000000..29cbe5f21 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_onehot_negative_indices_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_onehot_negative_indices_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_onehot_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_onehot_negative_indices/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_onehot_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_onehot_negative_indices_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_onehot_with_negative_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_onehot_with_negative_axis_tensorrt.cc new file mode 100644 index 000000000..44190a711 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_onehot_with_negative_axis_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_onehot_with_negative_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_onehot_with_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_onehot_with_negative_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_onehot_with_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_onehot_with_negative_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_int32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_int32_tensorrt.cc new file mode 100644 index 000000000..aaac3c3ba --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_int32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_int32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_int32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_pow_types_float32_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_int32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_int64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_int64_tensorrt.cc new file mode 100644 index 000000000..7504ff7b1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_int64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_int64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_int64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_pow_types_float32_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_int64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_uint32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_uint32_tensorrt.cc new file mode 100644 index 000000000..0516a3a88 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_uint32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_uint32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_uint32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_pow_types_float32_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_uint32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_uint64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_uint64_tensorrt.cc new file mode 100644 index 000000000..d16611eef --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float32_uint64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_uint64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_uint64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_pow_types_float32_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_uint64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float_tensorrt.cc new file mode 100644 index 000000000..7f1fff082 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_float_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_pow_types_float | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int32_float32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int32_float32_tensorrt.cc new file mode 100644 index 000000000..47d49ca29 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int32_float32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int32_float32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int32_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int32_float32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_pow_types_int32_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int32_float32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int32_int32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int32_int32_tensorrt.cc new file mode 100644 index 000000000..839ca9140 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int32_int32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int32_int32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int32_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int32_int32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_pow_types_int32_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int32_int32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int64_float32_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int64_float32_tensorrt.cc new file mode 100644 index 000000000..3fda672e7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int64_float32_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int64_float32_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int64_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int64_float32/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_pow_types_int64_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int64_float32_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int64_int64_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int64_int64_tensorrt.cc new file mode 100644 index 000000000..899e0f7a2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int64_int64_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int64_int64_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int64_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int64_int64/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_pow_types_int64_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int64_int64_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int_tensorrt.cc new file mode 100644 index 000000000..34e765ca5 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_pow_types_int_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_pow_types_int | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_quantizelinear_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_quantizelinear_axis_tensorrt.cc new file mode 100644 index 000000000..a7b75e1b4 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_quantizelinear_axis_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_quantizelinear_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_quantizelinear_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_quantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_quantizelinear_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_quantizelinear_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_range_float_type_positive_delta_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_range_float_type_positive_delta_expanded_tensorrt.cc new file mode 100644 index 000000000..01234ef1c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_range_float_type_positive_delta_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_range_float_type_positive_delta_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_float_type_positive_delta_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_float_type_positive_delta_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_range_float_type_positive_delta_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_float_type_positive_delta_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_range_float_type_positive_delta_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_range_float_type_positive_delta_tensorrt.cc new file mode 100644 index 000000000..fd11166b6 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_range_float_type_positive_delta_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_range_float_type_positive_delta_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_float_type_positive_delta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_float_type_positive_delta/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_range_float_type_positive_delta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_float_type_positive_delta_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_range_int32_type_negative_delta_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_range_int32_type_negative_delta_expanded_tensorrt.cc new file mode 100644 index 000000000..fdbc265f7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_range_int32_type_negative_delta_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_range_int32_type_negative_delta_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_int32_type_negative_delta_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_range_int32_type_negative_delta_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_int32_type_negative_delta_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_range_int32_type_negative_delta_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_range_int32_type_negative_delta_tensorrt.cc new file mode 100644 index 000000000..e0c3d339a --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_range_int32_type_negative_delta_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_range_int32_type_negative_delta_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_int32_type_negative_delta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_int32_type_negative_delta/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_range_int32_type_negative_delta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_int32_type_negative_delta_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_l1_negative_axes_keep_dims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_l1_negative_axes_keep_dims_example_tensorrt.cc new file mode 100644 index 000000000..5c8badc81 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_l1_negative_axes_keep_dims_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l1_negative_axes_keep_dims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l1_negative_axes_keep_dims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_l1_negative_axes_keep_dims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l1_negative_axes_keep_dims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_l1_negative_axes_keep_dims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_l1_negative_axes_keep_dims_random_tensorrt.cc new file mode 100644 index 000000000..96927b5c0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_l1_negative_axes_keep_dims_random_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l1_negative_axes_keep_dims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l1_negative_axes_keep_dims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_l1_negative_axes_keep_dims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l1_negative_axes_keep_dims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_l2_negative_axes_keep_dims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_l2_negative_axes_keep_dims_example_tensorrt.cc new file mode 100644 index 000000000..2e6ca5eeb --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_l2_negative_axes_keep_dims_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l2_negative_axes_keep_dims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l2_negative_axes_keep_dims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_l2_negative_axes_keep_dims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l2_negative_axes_keep_dims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_l2_negative_axes_keep_dims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_l2_negative_axes_keep_dims_random_tensorrt.cc new file mode 100644 index 000000000..ba6e1ee45 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_l2_negative_axes_keep_dims_random_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l2_negative_axes_keep_dims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l2_negative_axes_keep_dims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_l2_negative_axes_keep_dims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l2_negative_axes_keep_dims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_exp_negative_axes_keepdims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_exp_negative_axes_keepdims_example_tensorrt.cc new file mode 100644 index 000000000..3aa50571f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_exp_negative_axes_keepdims_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_exp_negative_axes_keepdims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_exp_negative_axes_keepdims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_exp_negative_axes_keepdims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_exp_negative_axes_keepdims_random_tensorrt.cc new file mode 100644 index 000000000..ddf9cfd1a --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_exp_negative_axes_keepdims_random_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_exp_negative_axes_keepdims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_exp_negative_axes_keepdims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_negative_axes_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_negative_axes_tensorrt.cc new file mode 100644 index 000000000..303571973 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_log_sum_negative_axes_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_negative_axes_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_negative_axes/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_log_sum_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_negative_axes_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_max_negative_axes_keepdims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_max_negative_axes_keepdims_example_tensorrt.cc new file mode 100644 index 000000000..1d384ea9e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_max_negative_axes_keepdims_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_max_negative_axes_keepdims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_max_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_max_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_max_negative_axes_keepdims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_max_negative_axes_keepdims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_max_negative_axes_keepdims_random_tensorrt.cc new file mode 100644 index 000000000..f3c272548 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_max_negative_axes_keepdims_random_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_max_negative_axes_keepdims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_max_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_max_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_max_negative_axes_keepdims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_mean_negative_axes_keepdims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_mean_negative_axes_keepdims_example_tensorrt.cc new file mode 100644 index 000000000..30f44a47d --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_mean_negative_axes_keepdims_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_mean_negative_axes_keepdims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_mean_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_mean_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_mean_negative_axes_keepdims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_mean_negative_axes_keepdims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_mean_negative_axes_keepdims_random_tensorrt.cc new file mode 100644 index 000000000..578aa7f4c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_mean_negative_axes_keepdims_random_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_mean_negative_axes_keepdims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_mean_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_mean_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_mean_negative_axes_keepdims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_min_negative_axes_keepdims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_min_negative_axes_keepdims_example_tensorrt.cc new file mode 100644 index 000000000..ff3128188 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_min_negative_axes_keepdims_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_min_negative_axes_keepdims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_min_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_min_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_min_negative_axes_keepdims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_min_negative_axes_keepdims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_min_negative_axes_keepdims_random_tensorrt.cc new file mode 100644 index 000000000..92164a154 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_min_negative_axes_keepdims_random_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_min_negative_axes_keepdims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_min_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_min_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_min_negative_axes_keepdims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_negative_axes_keepdims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_negative_axes_keepdims_example_tensorrt.cc new file mode 100644 index 000000000..71a8b0dff --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_negative_axes_keepdims_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_prod_negative_axes_keepdims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_prod_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_prod_negative_axes_keepdims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_negative_axes_keepdims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_negative_axes_keepdims_random_tensorrt.cc new file mode 100644 index 000000000..fb4816d0b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_negative_axes_keepdims_random_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_prod_negative_axes_keepdims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_prod_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_prod_negative_axes_keepdims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_empty_axes_input_noop_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_empty_axes_input_noop_example_tensorrt.cc new file mode 100644 index 000000000..531daf1ec --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_empty_axes_input_noop_example_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_empty_axes_input_noop_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_empty_axes_input_noop_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_sum_empty_axes_input_noop_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_empty_axes_input_noop_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_empty_axes_input_noop_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_empty_axes_input_noop_random_tensorrt.cc new file mode 100644 index 000000000..c5a41c3d3 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_empty_axes_input_noop_random_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_empty_axes_input_noop_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_empty_axes_input_noop_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_sum_empty_axes_input_noop_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_empty_axes_input_noop_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_negative_axes_keepdims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_negative_axes_keepdims_example_tensorrt.cc new file mode 100644 index 000000000..9bb4e2fac --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_negative_axes_keepdims_example_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_negative_axes_keepdims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_sum_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_negative_axes_keepdims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_negative_axes_keepdims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_negative_axes_keepdims_random_tensorrt.cc new file mode 100644 index 000000000..40e0c3d28 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_negative_axes_keepdims_random_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_negative_axes_keepdims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_sum_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_negative_axes_keepdims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_square_negative_axes_keepdims_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_square_negative_axes_keepdims_example_tensorrt.cc new file mode 100644 index 000000000..1578da0e9 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_square_negative_axes_keepdims_example_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_sum_square_negative_axes_keepdims_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_square_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_sum_square_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_square_negative_axes_keepdims_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_square_negative_axes_keepdims_random_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_square_negative_axes_keepdims_random_tensorrt.cc new file mode 100644 index 000000000..ee7e9b578 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reduce_sum_square_negative_axes_keepdims_random_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_reduce_sum_square_negative_axes_keepdims_random_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_square_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_sum_square_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_square_negative_axes_keepdims_random_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reshape_negative_extended_dims_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reshape_negative_extended_dims_tensorrt.cc new file mode 100644 index 000000000..2a3a2af35 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reshape_negative_extended_dims_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_reshape_negative_extended_dims_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_negative_extended_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_negative_extended_dims/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reshape_negative_extended_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_negative_extended_dims_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reshape_reordered_all_dims_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reshape_reordered_all_dims_tensorrt.cc new file mode 100644 index 000000000..feaee9cb1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reshape_reordered_all_dims_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_reshape_reordered_all_dims_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_reordered_all_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_reordered_all_dims/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reshape_reordered_all_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_reordered_all_dims_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reshape_reordered_last_dims_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reshape_reordered_last_dims_tensorrt.cc new file mode 100644 index 000000000..08fa32f11 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reshape_reordered_last_dims_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_reshape_reordered_last_dims_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_reordered_last_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_reordered_last_dims/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reshape_reordered_last_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_reordered_last_dims_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reshape_zero_and_negative_dim_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reshape_zero_and_negative_dim_tensorrt.cc new file mode 100644 index 000000000..80202ad62 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reshape_zero_and_negative_dim_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_reshape_zero_and_negative_dim_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_zero_and_negative_dim/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_zero_and_negative_dim/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reshape_zero_and_negative_dim | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_zero_and_negative_dim_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_reshape_zero_dim_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_reshape_zero_dim_tensorrt.cc new file mode 100644 index 000000000..830fdcc49 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_reshape_zero_dim_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_reshape_zero_dim_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_zero_dim/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_zero_dim/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reshape_zero_dim | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_zero_dim_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc new file mode 100644 index 000000000..7001bc778 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_align_corners_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_align_corners_tensorrt.cc new file mode 100644 index 000000000..33d85d0f2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_align_corners_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_align_corners_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_downsample_scales_cubic_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_align_corners_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_tensorrt.cc new file mode 100644 index 000000000..f2fa35f0a --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_cubic_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_downsample_scales_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_linear_align_corners_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_linear_align_corners_tensorrt.cc new file mode 100644 index 000000000..98c77373c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_linear_align_corners_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_linear_align_corners_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_linear_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_downsample_scales_linear_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_linear_align_corners_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_linear_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_linear_tensorrt.cc new file mode 100644 index 000000000..33aa221ab --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_linear_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_linear_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_linear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_linear/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_downsample_scales_linear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_linear_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_nearest_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_nearest_tensorrt.cc new file mode 100644 index 000000000..41dea6bd0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_scales_nearest_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_nearest_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_nearest/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_downsample_scales_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_nearest_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_cubic_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_cubic_tensorrt.cc new file mode 100644 index 000000000..db2417af2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_cubic_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_cubic_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_cubic/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_downsample_sizes_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_cubic_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_linear_pytorch_half_pixel_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_linear_pytorch_half_pixel_tensorrt.cc new file mode 100644 index 000000000..4f9b15082 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_linear_pytorch_half_pixel_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_linear_pytorch_half_pixel_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_linear_pytorch_half_pixel_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_nearest_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_nearest_tensorrt.cc new file mode 100644 index 000000000..b15472fd8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_nearest_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_nearest_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_nearest/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_downsample_sizes_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_nearest_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_tensorrt.cc new file mode 100644 index 000000000..e3723c4ea --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_tf_crop_and_resize_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_tf_crop_and_resize_tensorrt.cc new file mode 100644 index 000000000..5cfc92387 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_tf_crop_and_resize_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_resize_tf_crop_and_resize_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_tf_crop_and_resize/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_tf_crop_and_resize/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_tf_crop_and_resize | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_tf_crop_and_resize_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc new file mode 100644 index 000000000..4a8e91f92 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_align_corners_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_align_corners_tensorrt.cc new file mode 100644 index 000000000..3b8e9bd3e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_align_corners_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_align_corners_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_scales_cubic_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_align_corners_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_asymmetric_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_asymmetric_tensorrt.cc new file mode 100644 index 000000000..87d359306 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_asymmetric_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_asymmetric_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_asymmetric/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_scales_cubic_asymmetric | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_asymmetric_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_tensorrt.cc new file mode 100644 index 000000000..6c1006caa --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_cubic_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_scales_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_linear_align_corners_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_linear_align_corners_tensorrt.cc new file mode 100644 index 000000000..c2102a50c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_linear_align_corners_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_linear_align_corners_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_linear_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_scales_linear_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_linear_align_corners_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_linear_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_linear_tensorrt.cc new file mode 100644 index 000000000..ed87645c2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_linear_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_linear_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_linear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_linear/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_scales_linear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_linear_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_nearest_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_nearest_tensorrt.cc new file mode 100644 index 000000000..dbe24ae54 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_scales_nearest_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_nearest_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_nearest/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_scales_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_nearest_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_cubic_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_cubic_tensorrt.cc new file mode 100644 index 000000000..fd410ba1f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_cubic_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_cubic_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_cubic/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_sizes_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_cubic_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_ceil_half_pixel_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_ceil_half_pixel_tensorrt.cc new file mode 100644 index 000000000..9a6c4047f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_ceil_half_pixel_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_ceil_half_pixel_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_ceil_half_pixel_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_floor_align_corners_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_floor_align_corners_tensorrt.cc new file mode 100644 index 000000000..ee3266953 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_floor_align_corners_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_floor_align_corners_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_sizes_nearest_floor_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_floor_align_corners_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_tensorrt.cc new file mode 100644 index 000000000..badde3572 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_tensorrt.cc new file mode 100644 index 000000000..3f9c84b05 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_resize_upsample_sizes_nearest_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_resize_upsample_sizes_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_round_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_round_tensorrt.cc new file mode 100644 index 000000000..d85b29310 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_round_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_round_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_round/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_round/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_round/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_round/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_round/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_round/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_round | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_round_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_with_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_with_axis_tensorrt.cc new file mode 100644 index 000000000..fef241567 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_with_axis_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_with_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_with_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_with_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_scatter_elements_with_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_with_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_with_negative_indices_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_with_negative_indices_tensorrt.cc new file mode 100644 index 000000000..a6f8472d1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_with_negative_indices_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_with_negative_indices_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_with_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_with_negative_indices/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_scatter_elements_with_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_with_negative_indices_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_without_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_without_axis_tensorrt.cc new file mode 100644 index 000000000..641a48578 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_scatter_elements_without_axis_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_without_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_without_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_scatter_elements_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_without_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_scatternd_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_scatternd_tensorrt.cc new file mode 100644 index 000000000..ab06ea1e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_scatternd_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_scatternd_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatternd/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatternd/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_scatternd | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatternd_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..ba35924b6 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..b0d037200 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_log_prob_tensorrt.cc new file mode 100644 index 000000000..08c33a8db --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_log_prob_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_tensorrt.cc new file mode 100644 index 000000000..75bc33d29 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1_mean_weight_negative_ii_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1_mean_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..c2f5c119c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..5c7929d20 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_tensorrt.cc new file mode 100644 index 000000000..b71d5555b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc new file mode 100644 index 000000000..0e5f59133 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..255346aa6 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..f1e054f9c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_tensorrt.cc new file mode 100644 index 000000000..ca65f8ec1 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_tensorrt.cc new file mode 100644 index 000000000..a59f8e03c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3_sum_weight_high_ii_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3_sum_weight_high_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc new file mode 100644 index 000000000..18e7d51f8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..6c9948602 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_tensorrt.cc new file mode 100644 index 000000000..1430688a2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_tensorrt.cc new file mode 100644 index 000000000..76d3f1320 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_mean_weight_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3d4d5_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc new file mode 100644 index 000000000..11462d753 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..4bf6456e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_tensorrt.cc new file mode 100644 index 000000000..5423c4676 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_tensorrt.cc new file mode 100644 index 000000000..b56b4e89c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_NCd1d2d3d4d5_none_no_weight_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_NCd1d2d3d4d5_none_no_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_expanded_tensorrt.cc new file mode 100644 index 000000000..54ebc8517 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_3d_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..915e34730 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_log_prob_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_3d_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_log_prob_tensorrt.cc new file mode 100644 index 000000000..b39931aec --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_log_prob_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_3d_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_tensorrt.cc new file mode 100644 index 000000000..2e57eeb3e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_3d_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_3d_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_expanded_tensorrt.cc new file mode 100644 index 000000000..3ae2f2d00 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..21af69798 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_log_prob_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_log_prob_tensorrt.cc new file mode 100644 index 000000000..922b1c0a2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_log_prob_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_expanded_tensorrt.cc new file mode 100644 index 000000000..2da959b21 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_3d_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..a1ab36509 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_log_prob_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_3d_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_log_prob_tensorrt.cc new file mode 100644 index 000000000..b01b56623 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_log_prob_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_3d_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_tensorrt.cc new file mode 100644 index 000000000..70d49addd --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_3d_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_3d_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_expanded_tensorrt.cc new file mode 100644 index 000000000..b3c3e94fe --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_4d_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_4d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..7acb33602 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_log_prob_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_4d_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_log_prob_tensorrt.cc new file mode 100644 index 000000000..0c1d33d52 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_log_prob_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_4d_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_4d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_tensorrt.cc new file mode 100644 index 000000000..ef2a1a508 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_4d_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_4d_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_4d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..0a683b355 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..526a08951 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_log_prob_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_log_prob_tensorrt.cc new file mode 100644 index 000000000..14e2e7d86 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_log_prob_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_tensorrt.cc new file mode 100644 index 000000000..942026787 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_no_weight_ii_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_no_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_tensorrt.cc new file mode 100644 index 000000000..de8b7d8b2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_expanded_tensorrt.cc new file mode 100644 index 000000000..3e92b3f87 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_expanded_tensorrt.cc new file mode 100644 index 000000000..695fa6ce0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_3d_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..21a3d5b95 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_log_prob_expanded_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_3d_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_log_prob_tensorrt.cc new file mode 100644 index 000000000..cf1f2d279 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_log_prob_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_3d_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_tensorrt.cc new file mode 100644 index 000000000..2cc61d089 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_3d_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_3d_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_expanded_tensorrt.cc new file mode 100644 index 000000000..fdc4a47d6 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_4d_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_4d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..a3da820c8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_log_prob_expanded_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_4d_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_log_prob_tensorrt.cc new file mode 100644 index 000000000..ffc9f5d72 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_log_prob_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_4d_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_4d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_tensorrt.cc new file mode 100644 index 000000000..c657447b5 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_4d_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_4d_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_4d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_expanded_tensorrt.cc new file mode 100644 index 000000000..bac029d61 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..2988387a0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_log_prob_expanded_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_log_prob_tensorrt.cc new file mode 100644 index 000000000..30c341f78 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_log_prob_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_tensorrt.cc new file mode 100644 index 000000000..1148f3ca8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_ii_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..7e6af0ebc --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_log_prob_expanded_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_log_prob_tensorrt.cc new file mode 100644 index 000000000..57b537441 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_log_prob_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_tensorrt.cc new file mode 100644 index 000000000..bb3f5e3c7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_mean_weight_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_none_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_expanded_tensorrt.cc new file mode 100644 index 000000000..b84fe575b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_none_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_none_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_none_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..95548b518 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_log_prob_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_none_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_none_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_log_prob_tensorrt.cc new file mode 100644 index 000000000..0f9182f66 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_log_prob_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_none_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_none_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_tensorrt.cc new file mode 100644 index 000000000..1f62c3356 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_none_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_none | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_expanded_tensorrt.cc new file mode 100644 index 000000000..fea80e3d5 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_weights_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_none_weights_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..b607dce7e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_log_prob_expanded_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_none_weights_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_none_weights_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_log_prob_tensorrt.cc new file mode 100644 index 000000000..edc1c1fa2 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_log_prob_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_sce_none_weights_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_none_weights_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_tensorrt.cc new file mode 100644 index 000000000..94cce1564 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_none_weights_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_weights_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_none_weights | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_expanded_tensorrt.cc new file mode 100644 index 000000000..8a864237b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_expanded_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_sum_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_log_prob_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_log_prob_expanded_tensorrt.cc new file mode 100644 index 000000000..3918a57b9 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_log_prob_expanded_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_sum_log_prob_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_sum_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_log_prob_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_log_prob_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_log_prob_tensorrt.cc new file mode 100644 index 000000000..4919673be --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_log_prob_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sce_sum_log_prob_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_log_prob/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_sum_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_log_prob_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_tensorrt.cc new file mode 100644 index 000000000..cf00c3fab --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sce_sum_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sce_sum_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sce_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sequence_insert_at_back_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sequence_insert_at_back_tensorrt.cc new file mode 100644 index 000000000..e9dda2278 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sequence_insert_at_back_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_sequence_insert_at_back_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sequence_insert_at_back/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sequence_insert_at_back/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sequence_insert_at_back | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sequence_insert_at_back_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_sequence_insert_at_front_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_sequence_insert_at_front_tensorrt.cc new file mode 100644 index 000000000..f212edb52 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_sequence_insert_at_front_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_sequence_insert_at_front_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sequence_insert_at_front/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sequence_insert_at_front/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_sequence_insert_at_front | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sequence_insert_at_front_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_slice_negative_axes_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_slice_negative_axes_tensorrt.cc new file mode 100644 index 000000000..a3f712a4c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_slice_negative_axes_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_slice_negative_axes_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_slice_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_slice_negative_axes/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_slice_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_slice_negative_axes_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_0_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_0_expanded_tensorrt.cc new file mode 100644 index 000000000..70fb1674e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_0_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_0_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_0_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_0_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_0_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_0_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_0_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_0_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_softmax_axis_0_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_0_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_1_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_1_expanded_tensorrt.cc new file mode 100644 index 000000000..d918d3306 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_1_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_1_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_1_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_softmax_axis_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_1_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_2_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_2_expanded_tensorrt.cc new file mode 100644 index 000000000..3ab12228e --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_softmax_axis_2_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_2_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_2_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_softmax_axis_2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_2_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_softmax_default_axis_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_softmax_default_axis_expanded_tensorrt.cc new file mode 100644 index 000000000..26709e8b0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_softmax_default_axis_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_softmax_default_axis_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_default_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_default_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_default_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_default_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_default_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_default_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_softmax_default_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_default_axis_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_softmax_example_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_softmax_example_expanded_tensorrt.cc new file mode 100644 index 000000000..5adf3e0ba --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_softmax_example_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_softmax_example_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_example_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_example_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_example_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_example_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_example_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_example_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_softmax_example_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_example_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_softmax_large_number_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_softmax_large_number_expanded_tensorrt.cc new file mode 100644 index 000000000..dc3d40cae --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_softmax_large_number_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_softmax_large_number_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_large_number_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_large_number_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_large_number_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_large_number_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_large_number_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_large_number_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_softmax_large_number_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_large_number_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_softmax_negative_axis_expanded_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_softmax_negative_axis_expanded_tensorrt.cc new file mode 100644 index 000000000..b73d0314f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_softmax_negative_axis_expanded_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_softmax_negative_axis_expanded_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_negative_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_negative_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_softmax_negative_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_negative_axis_expanded_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_softmax_negative_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_softmax_negative_axis_tensorrt.cc new file mode 100644 index 000000000..5fa0ef127 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_softmax_negative_axis_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_softmax_negative_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_softmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_negative_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_split_zero_size_splits_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_split_zero_size_splits_tensorrt.cc new file mode 100644 index 000000000..4cd63f260 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_split_zero_size_splits_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_split_zero_size_splits_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_split_zero_size_splits/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_split_zero_size_splits/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_split_zero_size_splits | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_split_zero_size_splits_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_squeeze_negative_axes_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_squeeze_negative_axes_tensorrt.cc new file mode 100644 index 000000000..d01326c5b --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_squeeze_negative_axes_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_squeeze_negative_axes_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_squeeze_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_squeeze_negative_axes/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_squeeze_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_squeeze_negative_axes_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_top_k_negative_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_top_k_negative_axis_tensorrt.cc new file mode 100644 index 000000000..3578347cf --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_top_k_negative_axis_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_top_k_negative_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_top_k_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_top_k_negative_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_top_k_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_top_k_negative_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_top_k_smallest_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_top_k_smallest_tensorrt.cc new file mode 100644 index 000000000..f27bb22eb --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_top_k_smallest_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_top_k_smallest_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_top_k_smallest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_top_k_smallest/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_top_k_smallest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_top_k_smallest_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_default_mask_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_default_mask_tensorrt.cc new file mode 100644 index 000000000..04977cf53 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_default_mask_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_default_mask_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_default_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_default_mask/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_training_dropout_default_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_default_mask_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_default_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_default_tensorrt.cc new file mode 100644 index 000000000..62d59aa8f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_default_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_default_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_default/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_default/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_training_dropout_default | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_default_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_mask_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_mask_tensorrt.cc new file mode 100644 index 000000000..0792823a0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_mask_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_mask_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_mask/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_training_dropout_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_mask_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_tensorrt.cc new file mode 100644 index 000000000..4cbf02ac7 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_training_dropout | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_zero_ratio_mask_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_zero_ratio_mask_tensorrt.cc new file mode 100644 index 000000000..3b9be6dd0 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_zero_ratio_mask_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_zero_ratio_mask_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_zero_ratio_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_zero_ratio_mask/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_training_dropout_zero_ratio_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_zero_ratio_mask_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_zero_ratio_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_zero_ratio_tensorrt.cc new file mode 100644 index 000000000..39bc17675 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_training_dropout_zero_ratio_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_zero_ratio_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_zero_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_zero_ratio/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_training_dropout_zero_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_zero_ratio_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unique_not_sorted_without_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unique_not_sorted_without_axis_tensorrt.cc new file mode 100644 index 000000000..3ed5d09dd --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unique_not_sorted_without_axis_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_unique_not_sorted_without_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_not_sorted_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_not_sorted_without_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unique_not_sorted_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_not_sorted_without_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_axis_3d_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_axis_3d_tensorrt.cc new file mode 100644 index 000000000..396742d33 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_axis_3d_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_axis_3d_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_axis_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_axis_3d/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unique_sorted_with_axis_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_axis_3d_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_axis_tensorrt.cc new file mode 100644 index 000000000..619c7e209 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_axis_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unique_sorted_with_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_negative_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_negative_axis_tensorrt.cc new file mode 100644 index 000000000..e5d5927bc --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_with_negative_axis_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_negative_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_negative_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unique_sorted_with_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_negative_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_without_axis_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_without_axis_tensorrt.cc new file mode 100644 index 000000000..634fcf32a --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unique_sorted_without_axis_tensorrt.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_without_axis_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_without_axis/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unique_sorted_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_without_axis_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_0_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_0_tensorrt.cc new file mode 100644 index 000000000..aa4e969c8 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_0_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_0_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_0/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unsqueeze_axis_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_0_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_1_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_1_tensorrt.cc new file mode 100644 index 000000000..f250536cb --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_1_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_1_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_1/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unsqueeze_axis_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_1_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_2_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_2_tensorrt.cc new file mode 100644 index 000000000..2cc5bf92c --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_2_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_2_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_2/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unsqueeze_axis_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_2_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_3_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_3_tensorrt.cc new file mode 100644 index 000000000..a472c6f34 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_axis_3_tensorrt.cc @@ -0,0 +1,29 @@ +//===-test_unsqueeze_axis_3_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_3/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unsqueeze_axis_3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_3_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_negative_axes_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_negative_axes_tensorrt.cc new file mode 100644 index 000000000..2b9da34a6 --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_negative_axes_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_negative_axes_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_negative_axes/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unsqueeze_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_negative_axes_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_three_axes_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_three_axes_tensorrt.cc new file mode 100644 index 000000000..04dc82afa --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_three_axes_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_three_axes_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_three_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_three_axes/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unsqueeze_three_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_three_axes_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_two_axes_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_two_axes_tensorrt.cc new file mode 100644 index 000000000..859044d2f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_two_axes_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_two_axes_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_two_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_two_axes/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unsqueeze_two_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_two_axes_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_unsorted_axes_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_unsorted_axes_tensorrt.cc new file mode 100644 index 000000000..a3901dc5f --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_unsqueeze_unsorted_axes_tensorrt.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_unsorted_axes_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_unsorted_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_unsorted_axes/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_unsqueeze_unsorted_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_unsorted_axes_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_tensorrt/test_where_long_example_tensorrt.cc b/tests/unittests/lit_cases/test_tensorrt/test_where_long_example_tensorrt.cc new file mode 100644 index 000000000..00770656a --- /dev/null +++ b/tests/unittests/lit_cases/test_tensorrt/test_where_long_example_tensorrt.cc @@ -0,0 +1,31 @@ +//===-test_where_long_example_tensorrt.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on tensorrt +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_where_long_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_where_long_example/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations +// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_where_long_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_where_long_example_tensorrt.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_adagrad_multiple_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_adagrad_multiple_xnnpack.cc new file mode 100644 index 000000000..e4b54d565 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_adagrad_multiple_xnnpack.cc @@ -0,0 +1,39 @@ +//===-test_adagrad_multiple_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_adagrad_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adagrad_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adagrad_multiple/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_adagrad_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adagrad_multiple_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_adagrad_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_adagrad_xnnpack.cc new file mode 100644 index 000000000..fec037016 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_adagrad_xnnpack.cc @@ -0,0 +1,34 @@ +//===-test_adagrad_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adagrad/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adagrad/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adagrad/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adagrad/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_adagrad | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adagrad_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_adam_multiple_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_adam_multiple_xnnpack.cc new file mode 100644 index 000000000..6c7f86055 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_adam_multiple_xnnpack.cc @@ -0,0 +1,43 @@ +//===-test_adam_multiple_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_4.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_8.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_8.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/input_9.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/input_9.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam_multiple/test_data_set_0/output_5.cc -x onnx -emit-data-as-c %data_path/test_adam_multiple/test_data_set_0/output_5.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adam_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adam_multiple/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_adam_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adam_multiple_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_adam_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_adam_xnnpack.cc new file mode 100644 index 000000000..bb3f2bd86 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_adam_xnnpack.cc @@ -0,0 +1,36 @@ +//===-test_adam_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_adam/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_adam/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_adam/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_adam/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_adam | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_adam_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmax_default_axis_example_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmax_default_axis_example_select_last_index_xnnpack.cc new file mode 100644 index 000000000..8e7b9c19f --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmax_default_axis_example_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmax_default_axis_example_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_default_axis_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_default_axis_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmax_default_axis_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_default_axis_example_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmax_default_axis_random_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmax_default_axis_random_select_last_index_xnnpack.cc new file mode 100644 index 000000000..4d8a9c496 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmax_default_axis_random_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmax_default_axis_random_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_default_axis_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_default_axis_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmax_default_axis_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_default_axis_random_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmax_keepdims_example_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmax_keepdims_example_select_last_index_xnnpack.cc new file mode 100644 index 000000000..54e594d2c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmax_keepdims_example_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmax_keepdims_example_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmax_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_keepdims_example_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmax_keepdims_random_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmax_keepdims_random_select_last_index_xnnpack.cc new file mode 100644 index 000000000..a9bc9b595 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmax_keepdims_random_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmax_keepdims_random_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmax_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_keepdims_random_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_example_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_example_select_last_index_xnnpack.cc new file mode 100644 index 000000000..76f147a3c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_example_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_example_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmax_negative_axis_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_example_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_example_xnnpack.cc new file mode 100644 index 000000000..7cc2fabe1 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmax_negative_axis_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_random_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_random_select_last_index_xnnpack.cc new file mode 100644 index 000000000..cd1787df8 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_random_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_random_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmax_negative_axis_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_random_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_random_xnnpack.cc new file mode 100644 index 000000000..95eebda06 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmax_negative_axis_keepdims_random_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmax_negative_axis_keepdims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_negative_axis_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_negative_axis_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmax_negative_axis_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_negative_axis_keepdims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmax_no_keepdims_example_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmax_no_keepdims_example_select_last_index_xnnpack.cc new file mode 100644 index 000000000..139496430 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmax_no_keepdims_example_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmax_no_keepdims_example_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_no_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_no_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmax_no_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_no_keepdims_example_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmax_no_keepdims_random_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmax_no_keepdims_random_select_last_index_xnnpack.cc new file mode 100644 index 000000000..e1bf039a8 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmax_no_keepdims_random_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmax_no_keepdims_random_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmax_no_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmax_no_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmax_no_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmax_no_keepdims_random_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmin_default_axis_example_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmin_default_axis_example_select_last_index_xnnpack.cc new file mode 100644 index 000000000..d119eea49 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmin_default_axis_example_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmin_default_axis_example_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_default_axis_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_default_axis_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmin_default_axis_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_default_axis_example_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmin_default_axis_random_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmin_default_axis_random_select_last_index_xnnpack.cc new file mode 100644 index 000000000..5d4795d85 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmin_default_axis_random_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmin_default_axis_random_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_default_axis_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_default_axis_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmin_default_axis_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_default_axis_random_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmin_keepdims_example_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmin_keepdims_example_select_last_index_xnnpack.cc new file mode 100644 index 000000000..5951b7324 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmin_keepdims_example_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmin_keepdims_example_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmin_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_keepdims_example_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmin_keepdims_random_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmin_keepdims_random_select_last_index_xnnpack.cc new file mode 100644 index 000000000..b113aa433 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmin_keepdims_random_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmin_keepdims_random_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmin_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_keepdims_random_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_example_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_example_select_last_index_xnnpack.cc new file mode 100644 index 000000000..3c28ebb09 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_example_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_example_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmin_negative_axis_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_example_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_example_xnnpack.cc new file mode 100644 index 000000000..da2c4a96a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmin_negative_axis_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_random_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_random_select_last_index_xnnpack.cc new file mode 100644 index 000000000..b0742911b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_random_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_random_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmin_negative_axis_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_random_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_random_xnnpack.cc new file mode 100644 index 000000000..eccdcf468 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmin_negative_axis_keepdims_random_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmin_negative_axis_keepdims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_negative_axis_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_negative_axis_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmin_negative_axis_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_negative_axis_keepdims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmin_no_keepdims_example_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmin_no_keepdims_example_select_last_index_xnnpack.cc new file mode 100644 index 000000000..655741307 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmin_no_keepdims_example_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmin_no_keepdims_example_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_no_keepdims_example_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_no_keepdims_example_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmin_no_keepdims_example_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_no_keepdims_example_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_argmin_no_keepdims_random_select_last_index_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_argmin_no_keepdims_random_select_last_index_xnnpack.cc new file mode 100644 index 000000000..456c61824 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_argmin_no_keepdims_random_select_last_index_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_argmin_no_keepdims_random_select_last_index_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_argmin_no_keepdims_random_select_last_index/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_argmin_no_keepdims_random_select_last_index/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_argmin_no_keepdims_random_select_last_index | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_argmin_no_keepdims_random_select_last_index_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint16_xnnpack.cc new file mode 100644 index 000000000..046c90a0e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_bitshift_left_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint32_xnnpack.cc new file mode 100644 index 000000000..637d01b6a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_bitshift_left_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint64_xnnpack.cc new file mode 100644 index 000000000..f8bef7916 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_bitshift_left_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint8_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint8_xnnpack.cc new file mode 100644 index 000000000..91d926c11 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_left_uint8_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_left_uint8_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_left_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_left_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_left_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_left_uint8/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_bitshift_left_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_left_uint8_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint16_xnnpack.cc new file mode 100644 index 000000000..1eb2ccacb --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_bitshift_right_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint32_xnnpack.cc new file mode 100644 index 000000000..ae3da342e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_bitshift_right_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint64_xnnpack.cc new file mode 100644 index 000000000..ca4c2e9ce --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_bitshift_right_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint8_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint8_xnnpack.cc new file mode 100644 index 000000000..7a8900c12 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_bitshift_right_uint8_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_bitshift_right_uint8_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_bitshift_right_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_bitshift_right_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_bitshift_right_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_bitshift_right_uint8/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_bitshift_right_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_bitshift_right_uint8_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_cast_BFLOAT16_to_FLOAT_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_cast_BFLOAT16_to_FLOAT_xnnpack.cc new file mode 100644 index 000000000..bd98159f4 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_cast_BFLOAT16_to_FLOAT_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_cast_BFLOAT16_to_FLOAT_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cast_BFLOAT16_to_FLOAT/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cast_BFLOAT16_to_FLOAT/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_cast_BFLOAT16_to_FLOAT | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cast_BFLOAT16_to_FLOAT_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_cast_FLOAT_to_BFLOAT16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_cast_FLOAT_to_BFLOAT16_xnnpack.cc new file mode 100644 index 000000000..40e09d5cb --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_cast_FLOAT_to_BFLOAT16_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_cast_FLOAT_to_BFLOAT16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cast_FLOAT_to_BFLOAT16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cast_FLOAT_to_BFLOAT16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_cast_FLOAT_to_BFLOAT16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cast_FLOAT_to_BFLOAT16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_celu_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_celu_expanded_xnnpack.cc new file mode 100644 index 000000000..1b5b242fd --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_celu_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_celu_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_celu_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_celu_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_celu_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_celu_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_celu_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_celu_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_celu_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_celu_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_celu_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_celu_xnnpack.cc new file mode 100644 index 000000000..84bfe9395 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_celu_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_celu_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_celu/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_celu/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_celu/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_celu/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_celu/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_celu/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_celu | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_celu_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_inbounds_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_inbounds_xnnpack.cc new file mode 100644 index 000000000..26c7bf0af --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_inbounds_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_clip_default_int8_inbounds_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_inbounds/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_inbounds/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_inbounds/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_inbounds/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_inbounds/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_inbounds/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_clip_default_int8_inbounds | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_inbounds_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_max_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_max_xnnpack.cc new file mode 100644 index 000000000..90b4f7d84 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_max_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_clip_default_int8_max_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_max/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_max/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_max/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_max/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_clip_default_int8_max | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_max_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_min_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_min_xnnpack.cc new file mode 100644 index 000000000..94571da03 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_clip_default_int8_min_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_clip_default_int8_min_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_clip_default_int8_min/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_clip_default_int8_min/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_clip_default_int8_min/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_clip_default_int8_min/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_clip_default_int8_min | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_clip_default_int8_min_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_compress_negative_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_compress_negative_axis_xnnpack.cc new file mode 100644 index 000000000..c43154be2 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_compress_negative_axis_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_compress_negative_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_compress_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_compress_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_compress_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_compress_negative_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_compress_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_compress_negative_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_concat_1d_axis_negative_1_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_concat_1d_axis_negative_1_xnnpack.cc new file mode 100644 index 000000000..f5568d875 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_concat_1d_axis_negative_1_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_concat_1d_axis_negative_1_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_1d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_1d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_1d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_concat_1d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_1d_axis_negative_1_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_concat_2d_axis_negative_1_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_concat_2d_axis_negative_1_xnnpack.cc new file mode 100644 index 000000000..023a7b36e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_concat_2d_axis_negative_1_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_concat_2d_axis_negative_1_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_2d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_2d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_concat_2d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_2d_axis_negative_1_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_concat_2d_axis_negative_2_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_concat_2d_axis_negative_2_xnnpack.cc new file mode 100644 index 000000000..86a7e4823 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_concat_2d_axis_negative_2_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_concat_2d_axis_negative_2_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_2d_axis_negative_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_2d_axis_negative_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_2d_axis_negative_2/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_concat_2d_axis_negative_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_2d_axis_negative_2_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_1_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_1_xnnpack.cc new file mode 100644 index 000000000..7f978f61e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_1_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_1_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_1/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_concat_3d_axis_negative_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_1_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_2_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_2_xnnpack.cc new file mode 100644 index 000000000..05e4b7a94 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_2_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_2_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_2/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_concat_3d_axis_negative_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_2_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_3_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_3_xnnpack.cc new file mode 100644 index 000000000..8754657f5 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_concat_3d_axis_negative_3_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_concat_3d_axis_negative_3_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_concat_3d_axis_negative_3/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_concat_3d_axis_negative_3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_concat_3d_axis_negative_3/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_concat_3d_axis_negative_3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_concat_3d_axis_negative_3_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_constantofshape_int_shape_zero_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_constantofshape_int_shape_zero_xnnpack.cc new file mode 100644 index 000000000..b95e19248 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_constantofshape_int_shape_zero_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_constantofshape_int_shape_zero_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_constantofshape_int_shape_zero/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_constantofshape_int_shape_zero/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_constantofshape_int_shape_zero/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_constantofshape_int_shape_zero/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_constantofshape_int_shape_zero/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_constantofshape_int_shape_zero/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_constantofshape_int_shape_zero | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_constantofshape_int_shape_zero_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_exclusive_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_exclusive_xnnpack.cc new file mode 100644 index 000000000..87d325935 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_exclusive_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_exclusive_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_exclusive/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_exclusive/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_exclusive/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_cumsum_1d_exclusive | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_exclusive_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_reverse_exclusive_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_reverse_exclusive_xnnpack.cc new file mode 100644 index 000000000..dd141c276 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_reverse_exclusive_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_reverse_exclusive_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_reverse_exclusive/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_reverse_exclusive/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_cumsum_1d_reverse_exclusive | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_reverse_exclusive_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_reverse_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_reverse_xnnpack.cc new file mode 100644 index 000000000..9d19890cd --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_reverse_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_reverse_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d_reverse/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d_reverse/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d_reverse/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d_reverse/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_cumsum_1d_reverse | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_reverse_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_xnnpack.cc new file mode 100644 index 000000000..9c7391420 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_1d_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_1d_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_1d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_1d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_1d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_1d/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_cumsum_1d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_1d_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_axis_0_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_axis_0_xnnpack.cc new file mode 100644 index 000000000..d7e664584 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_axis_0_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_axis_0_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_axis_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_axis_0/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_cumsum_2d_axis_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_axis_0_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_axis_1_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_axis_1_xnnpack.cc new file mode 100644 index 000000000..e0fef36fd --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_axis_1_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_axis_1_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_axis_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_axis_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_axis_1/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_cumsum_2d_axis_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_axis_1_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_negative_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_negative_axis_xnnpack.cc new file mode 100644 index 000000000..2540763cc --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_cumsum_2d_negative_axis_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_cumsum_2d_negative_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_cumsum_2d_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_cumsum_2d_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_cumsum_2d_negative_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_cumsum_2d_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_cumsum_2d_negative_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_depthtospace_crd_mode_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_depthtospace_crd_mode_example_xnnpack.cc new file mode 100644 index 000000000..9bcfe46ed --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_depthtospace_crd_mode_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_crd_mode_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_crd_mode_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_crd_mode_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_depthtospace_crd_mode_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_crd_mode_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_depthtospace_crd_mode_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_depthtospace_crd_mode_xnnpack.cc new file mode 100644 index 000000000..231db2de8 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_depthtospace_crd_mode_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_crd_mode_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_crd_mode/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_crd_mode/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_crd_mode/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_crd_mode/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_depthtospace_crd_mode | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_crd_mode_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_depthtospace_dcr_mode_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_depthtospace_dcr_mode_xnnpack.cc new file mode 100644 index 000000000..ecf436664 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_depthtospace_dcr_mode_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_depthtospace_dcr_mode_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_dcr_mode/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_dcr_mode/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_depthtospace_dcr_mode/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_depthtospace_dcr_mode/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_depthtospace_dcr_mode/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_depthtospace_dcr_mode/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_depthtospace_dcr_mode | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_depthtospace_dcr_mode_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dequantizelinear_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dequantizelinear_axis_xnnpack.cc new file mode 100644 index 000000000..476e55163 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dequantizelinear_axis_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_dequantizelinear_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dequantizelinear_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dequantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dequantizelinear_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dequantizelinear_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_det_2d_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_det_2d_xnnpack.cc new file mode 100644 index 000000000..a809267b3 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_det_2d_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_det_2d_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_det_2d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_det_2d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_det_2d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_det_2d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_det_2d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_det_2d/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_det_2d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_det_2d_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_det_nd_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_det_nd_xnnpack.cc new file mode 100644 index 000000000..93a4f686d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_det_nd_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_det_nd_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_det_nd/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_det_nd/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_det_nd/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_det_nd/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_det_nd/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_det_nd/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_det_nd | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_det_nd_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_mask_ratio_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_mask_ratio_xnnpack.cc new file mode 100644 index 000000000..b89c9d113 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_mask_ratio_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_dropout_default_mask_ratio_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_mask_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_mask_ratio/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dropout_default_mask_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_mask_ratio_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_mask_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_mask_xnnpack.cc new file mode 100644 index 000000000..5c90fab96 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_mask_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_dropout_default_mask_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_mask/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dropout_default_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_mask_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_old_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_old_xnnpack.cc new file mode 100644 index 000000000..c3e02b2c6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_old_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_dropout_default_old_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_old/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_old/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_old/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_old/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_old/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_old/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dropout_default_old | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_old_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_ratio_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_ratio_xnnpack.cc new file mode 100644 index 000000000..a28f84374 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dropout_default_ratio_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_dropout_default_ratio_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_default_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dropout_default_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_default_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_default_ratio/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dropout_default_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_default_ratio_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dropout_random_old_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dropout_random_old_xnnpack.cc new file mode 100644 index 000000000..7fa7bf198 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dropout_random_old_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_dropout_random_old_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_random_old/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_random_old/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dropout_random_old/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dropout_random_old/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dropout_random_old/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dropout_random_old/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dropout_random_old | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dropout_random_old_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_expanded_xnnpack.cc new file mode 100644 index 000000000..832ed4510 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dynamicquantizelinear_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_max_adjusted_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_max_adjusted_expanded_xnnpack.cc new file mode 100644 index 000000000..3b78f0d7d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_max_adjusted_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_max_adjusted_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_max_adjusted_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_max_adjusted_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dynamicquantizelinear_max_adjusted_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_max_adjusted_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_max_adjusted_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_max_adjusted_xnnpack.cc new file mode 100644 index 000000000..50bf11aea --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_max_adjusted_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_max_adjusted_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_max_adjusted/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_max_adjusted/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dynamicquantizelinear_max_adjusted | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_max_adjusted_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_min_adjusted_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_min_adjusted_expanded_xnnpack.cc new file mode 100644 index 000000000..1b96dc3b5 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_min_adjusted_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_min_adjusted_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_min_adjusted_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_min_adjusted_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dynamicquantizelinear_min_adjusted_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_min_adjusted_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_min_adjusted_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_min_adjusted_xnnpack.cc new file mode 100644 index 000000000..14539cefc --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_min_adjusted_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_min_adjusted_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear_min_adjusted/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear_min_adjusted/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dynamicquantizelinear_min_adjusted | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_min_adjusted_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_xnnpack.cc new file mode 100644 index 000000000..43f350137 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_dynamicquantizelinear_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_dynamicquantizelinear_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_dynamicquantizelinear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dynamicquantizelinear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dynamicquantizelinear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dynamicquantizelinear/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_dynamicquantizelinear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_dynamicquantizelinear_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_einsum_batch_diagonal_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_einsum_batch_diagonal_xnnpack.cc new file mode 100644 index 000000000..4eac65416 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_einsum_batch_diagonal_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_einsum_batch_diagonal_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_diagonal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_diagonal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_diagonal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_diagonal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_batch_diagonal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_batch_diagonal/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_einsum_batch_diagonal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_batch_diagonal_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_einsum_batch_matmul_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_einsum_batch_matmul_xnnpack.cc new file mode 100644 index 000000000..60488f221 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_einsum_batch_matmul_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_einsum_batch_matmul_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_batch_matmul/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_einsum_batch_matmul/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_batch_matmul/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_batch_matmul/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_einsum_batch_matmul | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_batch_matmul_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_einsum_inner_prod_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_einsum_inner_prod_xnnpack.cc new file mode 100644 index 000000000..f67b8f4e9 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_einsum_inner_prod_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_einsum_inner_prod_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_inner_prod/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_einsum_inner_prod/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_inner_prod/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_inner_prod/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_einsum_inner_prod | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_inner_prod_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_einsum_sum_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_einsum_sum_xnnpack.cc new file mode 100644 index 000000000..5b40e41cc --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_einsum_sum_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_einsum_sum_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_sum/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_einsum_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_sum_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_einsum_transpose_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_einsum_transpose_xnnpack.cc new file mode 100644 index 000000000..e1667b956 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_einsum_transpose_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_einsum_transpose_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_transpose/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_transpose/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_einsum_transpose/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_einsum_transpose/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_einsum_transpose/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_einsum_transpose/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_einsum_transpose | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_einsum_transpose_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis1_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis1_xnnpack.cc new file mode 100644 index 000000000..1ba9a56b1 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis1_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis1_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis1/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_flatten_negative_axis1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis1_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis2_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis2_xnnpack.cc new file mode 100644 index 000000000..f7277b6e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis2_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis2_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis2/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_flatten_negative_axis2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis2_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis3_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis3_xnnpack.cc new file mode 100644 index 000000000..8df38b298 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis3_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis3_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis3/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_flatten_negative_axis3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis3_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis4_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis4_xnnpack.cc new file mode 100644 index 000000000..a58108c6f --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_flatten_negative_axis4_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_flatten_negative_axis4_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis4/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis4/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_flatten_negative_axis4/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_flatten_negative_axis4/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_flatten_negative_axis4/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_flatten_negative_axis4/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_flatten_negative_axis4 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_flatten_negative_axis4_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gather_2d_indices_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gather_2d_indices_xnnpack.cc new file mode 100644 index 000000000..844cda0c6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gather_2d_indices_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_gather_2d_indices_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_2d_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_2d_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_2d_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_2d_indices/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gather_2d_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_2d_indices_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gather_elements_0_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gather_elements_0_xnnpack.cc new file mode 100644 index 000000000..b3271f492 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gather_elements_0_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_0_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_0/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gather_elements_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_0_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gather_elements_1_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gather_elements_1_xnnpack.cc new file mode 100644 index 000000000..a6866ec6b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gather_elements_1_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_1_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_1/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gather_elements_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_1_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gather_elements_negative_indices_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gather_elements_negative_indices_xnnpack.cc new file mode 100644 index 000000000..2ad74b6ba --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gather_elements_negative_indices_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_gather_elements_negative_indices_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_elements_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_elements_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_elements_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_elements_negative_indices/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gather_elements_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_elements_negative_indices_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gather_negative_indices_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gather_negative_indices_xnnpack.cc new file mode 100644 index 000000000..89f2d3586 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gather_negative_indices_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_gather_negative_indices_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gather_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gather_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gather_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gather_negative_indices/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gather_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gather_negative_indices_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_float32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_float32_xnnpack.cc new file mode 100644 index 000000000..2ad4ab162 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_float32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_float32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_float32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gathernd_example_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_float32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_int32_batch_dim1_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_int32_batch_dim1_xnnpack.cc new file mode 100644 index 000000000..4213105c7 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_int32_batch_dim1_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_int32_batch_dim1_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_int32_batch_dim1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_int32_batch_dim1/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gathernd_example_int32_batch_dim1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_int32_batch_dim1_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_int32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_int32_xnnpack.cc new file mode 100644 index 000000000..6136adf3f --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gathernd_example_int32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_gathernd_example_int32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gathernd_example_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gathernd_example_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gathernd_example_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gathernd_example_int32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gathernd_example_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gathernd_example_int32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_all_attributes_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_all_attributes_xnnpack.cc new file mode 100644 index 000000000..bd0001343 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_all_attributes_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_gemm_all_attributes_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_all_attributes/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_all_attributes/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_all_attributes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_all_attributes/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_all_attributes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_all_attributes_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_alpha_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_alpha_xnnpack.cc new file mode 100644 index 000000000..e59cda834 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_alpha_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_gemm_alpha_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_alpha/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_alpha/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_alpha/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_alpha/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_alpha | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_alpha_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_beta_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_beta_xnnpack.cc new file mode 100644 index 000000000..e0c94ae5a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_beta_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_gemm_beta_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_beta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_beta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_beta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_beta/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_beta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_beta_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_matrix_bias_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_matrix_bias_xnnpack.cc new file mode 100644 index 000000000..20ff393b0 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_matrix_bias_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_matrix_bias_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_matrix_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_matrix_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_matrix_bias/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_default_matrix_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_matrix_bias_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_no_bias_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_no_bias_xnnpack.cc new file mode 100644 index 000000000..a47f6a55e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_no_bias_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_gemm_default_no_bias_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_no_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_no_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_no_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_no_bias/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_default_no_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_no_bias_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_scalar_bias_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_scalar_bias_xnnpack.cc new file mode 100644 index 000000000..50c441b0b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_scalar_bias_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_scalar_bias_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_scalar_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_scalar_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_scalar_bias/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_default_scalar_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_scalar_bias_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_single_elem_vector_bias_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_single_elem_vector_bias_xnnpack.cc new file mode 100644 index 000000000..a08ef5614 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_single_elem_vector_bias_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_single_elem_vector_bias_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_single_elem_vector_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_single_elem_vector_bias/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_default_single_elem_vector_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_single_elem_vector_bias_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_vector_bias_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_vector_bias_xnnpack.cc new file mode 100644 index 000000000..d3c955d9c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_vector_bias_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_vector_bias_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_vector_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_vector_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_vector_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_vector_bias/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_default_vector_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_vector_bias_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_zero_bias_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_zero_bias_xnnpack.cc new file mode 100644 index 000000000..c10290e84 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_default_zero_bias_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_gemm_default_zero_bias_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_default_zero_bias/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_default_zero_bias/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_default_zero_bias/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_default_zero_bias/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_default_zero_bias | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_default_zero_bias_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_transposeA_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_transposeA_xnnpack.cc new file mode 100644 index 000000000..665af3540 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_transposeA_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_gemm_transposeA_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeA/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeA/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_transposeA/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_transposeA/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_transposeA | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_transposeA_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_gemm_transposeB_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_gemm_transposeB_xnnpack.cc new file mode 100644 index 000000000..808e057a5 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_gemm_transposeB_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_gemm_transposeB_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_gemm_transposeB/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_gemm_transposeB/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_gemm_transposeB/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_gemm_transposeB/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_gemm_transposeB | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_gemm_transposeB_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_bcast_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_bcast_expanded_xnnpack.cc new file mode 100644 index 000000000..dd47f8971 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_bcast_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_bcast_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_bcast_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_bcast_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_greater_equal_bcast_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_bcast_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_bcast_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_bcast_xnnpack.cc new file mode 100644 index 000000000..db60cc6de --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_bcast_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_bcast_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_bcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_bcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_bcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_bcast/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_greater_equal_bcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_bcast_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_expanded_xnnpack.cc new file mode 100644 index 000000000..771268a29 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_greater_equal_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_xnnpack.cc new file mode 100644 index 000000000..b6971e494 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_greater_equal_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_greater_equal_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_greater_equal/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_greater_equal/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_greater_equal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_greater_equal/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_greater_equal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_greater_equal_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_hardmax_negative_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_hardmax_negative_axis_xnnpack.cc new file mode 100644 index 000000000..368f3b0e4 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_hardmax_negative_axis_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_hardmax_negative_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_hardmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_hardmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_hardmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_hardmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_hardmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_hardmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_hardmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_hardmax_negative_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_if_seq_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_if_seq_xnnpack.cc new file mode 100644 index 000000000..50be2baf6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_if_seq_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_if_seq_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_if_seq/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_if_seq/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_if_seq/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_if_seq/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_if_seq/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_if_seq/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_if_seq | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_if_seq_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_if_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_if_xnnpack.cc new file mode 100644 index 000000000..821c760c6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_if_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_if_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_if/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_if/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_if/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_if/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_if/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_if/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_if | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_if_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_less_equal_bcast_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_less_equal_bcast_expanded_xnnpack.cc new file mode 100644 index 000000000..f36c85f00 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_less_equal_bcast_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_bcast_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_bcast_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_bcast_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_less_equal_bcast_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_bcast_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_less_equal_bcast_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_less_equal_bcast_xnnpack.cc new file mode 100644 index 000000000..5d54a502d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_less_equal_bcast_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_bcast_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_bcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_bcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_bcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_bcast/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_less_equal_bcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_bcast_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_less_equal_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_less_equal_expanded_xnnpack.cc new file mode 100644 index 000000000..27ed9ec19 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_less_equal_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_less_equal_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_less_equal_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_less_equal_xnnpack.cc new file mode 100644 index 000000000..2619ffc14 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_less_equal_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_less_equal_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_less_equal/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_less_equal/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_less_equal/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_less_equal/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_less_equal | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_less_equal_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_0_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_0_expanded_xnnpack.cc new file mode 100644 index 000000000..a8668ea2c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_0_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_0_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_0_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_0_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_0_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_logsoftmax_axis_0_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_0_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_1_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_1_expanded_xnnpack.cc new file mode 100644 index 000000000..37299cc24 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_1_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_1_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_1_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_logsoftmax_axis_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_1_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_2_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_2_expanded_xnnpack.cc new file mode 100644 index 000000000..bd517fccb --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_axis_2_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_axis_2_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_axis_2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_axis_2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_axis_2_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_logsoftmax_axis_2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_axis_2_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_default_axis_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_default_axis_expanded_xnnpack.cc new file mode 100644 index 000000000..488351631 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_default_axis_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_default_axis_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_default_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_default_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_default_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_logsoftmax_default_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_default_axis_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_example_1_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_example_1_expanded_xnnpack.cc new file mode 100644 index 000000000..c665d9eb1 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_example_1_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_example_1_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_example_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_example_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_example_1_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_logsoftmax_example_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_example_1_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_large_number_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_large_number_expanded_xnnpack.cc new file mode 100644 index 000000000..610251407 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_large_number_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_large_number_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_large_number_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_large_number_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_large_number_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_logsoftmax_large_number_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_large_number_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_negative_axis_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_negative_axis_expanded_xnnpack.cc new file mode 100644 index 000000000..6d59cef34 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_negative_axis_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_negative_axis_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_negative_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_negative_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_logsoftmax_negative_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_negative_axis_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_negative_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_negative_axis_xnnpack.cc new file mode 100644 index 000000000..ff3c4284c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_logsoftmax_negative_axis_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_logsoftmax_negative_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_logsoftmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_logsoftmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_logsoftmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_logsoftmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_logsoftmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_logsoftmax_negative_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_loop11_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_loop11_xnnpack.cc new file mode 100644 index 000000000..45ca1b3fe --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_loop11_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_loop11_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop11/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_loop11/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_loop11/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_loop11/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_loop11 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_loop11_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_loop13_seq_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_loop13_seq_xnnpack.cc new file mode 100644 index 000000000..6a4af7f34 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_loop13_seq_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_loop13_seq_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_loop13_seq/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_loop13_seq/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_loop13_seq/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_loop13_seq/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_loop13_seq | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_loop13_seq_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_float16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_float16_xnnpack.cc new file mode 100644 index 000000000..88252db93 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_float16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_float16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_float32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_float32_xnnpack.cc new file mode 100644 index 000000000..95521289f --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_float32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_float32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_float64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_float64_xnnpack.cc new file mode 100644 index 000000000..8d4872ad8 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_float64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_float64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_float64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_float64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_int16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_int16_xnnpack.cc new file mode 100644 index 000000000..f8c580835 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_int16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_int16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_int32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_int32_xnnpack.cc new file mode 100644 index 000000000..b49c6132f --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_int32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_int32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_int64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_int64_xnnpack.cc new file mode 100644 index 000000000..fe8995a51 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_int64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_int64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_int8_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_int8_xnnpack.cc new file mode 100644 index 000000000..069fb1d01 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_int8_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_int8_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_int8/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_int8_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_uint16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_uint16_xnnpack.cc new file mode 100644 index 000000000..9331a9017 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_uint16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_uint16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_uint32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_uint32_xnnpack.cc new file mode 100644 index 000000000..4dd692d19 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_uint32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_uint32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_uint64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_uint64_xnnpack.cc new file mode 100644 index 000000000..def217d95 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_uint64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_uint64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_max_uint8_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_max_uint8_xnnpack.cc new file mode 100644 index 000000000..bbf922bbd --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_max_uint8_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_max_uint8_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_max_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_max_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_max_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_max_uint8/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_max_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_max_uint8_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_maxpool_2d_uint8_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_maxpool_2d_uint8_xnnpack.cc new file mode 100644 index 000000000..9eae32332 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_maxpool_2d_uint8_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_maxpool_2d_uint8_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_maxpool_2d_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_maxpool_2d_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_maxpool_2d_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_maxpool_2d_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_maxpool_2d_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_maxpool_2d_uint8/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_maxpool_2d_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_maxpool_2d_uint8_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_float16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_float16_xnnpack.cc new file mode 100644 index 000000000..93e3b3d8b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_float16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_float16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_float32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_float32_xnnpack.cc new file mode 100644 index 000000000..1c86af3b0 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_float32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_float32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_float64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_float64_xnnpack.cc new file mode 100644 index 000000000..3f2c0a09f --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_float64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_float64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_float64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_float64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_int16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_int16_xnnpack.cc new file mode 100644 index 000000000..88b0528fa --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_int16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_int16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_int32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_int32_xnnpack.cc new file mode 100644 index 000000000..e25567474 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_int32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_int32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_int64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_int64_xnnpack.cc new file mode 100644 index 000000000..5511d27bf --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_int64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_int64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_int8_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_int8_xnnpack.cc new file mode 100644 index 000000000..e200915ed --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_int8_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_int8_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_int8/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_int8_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_uint16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_uint16_xnnpack.cc new file mode 100644 index 000000000..2663b53c3 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_uint16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_uint16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_uint32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_uint32_xnnpack.cc new file mode 100644 index 000000000..e2eca616d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_uint32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_uint32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_uint64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_uint64_xnnpack.cc new file mode 100644 index 000000000..2f4d643f4 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_uint64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_uint64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_min_uint8_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_min_uint8_xnnpack.cc new file mode 100644 index 000000000..1807deaec --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_min_uint8_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_min_uint8_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_min_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_min_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_min_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_min_uint8/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_min_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_min_uint8_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_broadcast_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_broadcast_xnnpack.cc new file mode 100644 index 000000000..f1e55a2f3 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_broadcast_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_broadcast_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_broadcast/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_broadcast/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_broadcast/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_broadcast/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_broadcast | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_broadcast_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_int64_fmod_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_int64_fmod_xnnpack.cc new file mode 100644 index 000000000..41c9af4e0 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_int64_fmod_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_int64_fmod_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_int64_fmod/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_int64_fmod/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_int64_fmod/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_int64_fmod/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_int64_fmod | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_int64_fmod_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float16_xnnpack.cc new file mode 100644 index 000000000..059e0e5de --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_mixed_sign_float16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float32_xnnpack.cc new file mode 100644 index 000000000..b4a98e2c1 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_mixed_sign_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float64_xnnpack.cc new file mode 100644 index 000000000..ba70ba23b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_float64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_float64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_float64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_float64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_float64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_mixed_sign_float64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_float64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int16_xnnpack.cc new file mode 100644 index 000000000..4a0e4e253 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_mixed_sign_int16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int32_xnnpack.cc new file mode 100644 index 000000000..c0718e2c7 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_mixed_sign_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int64_xnnpack.cc new file mode 100644 index 000000000..e0430865a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_mixed_sign_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int8_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int8_xnnpack.cc new file mode 100644 index 000000000..9d99d53c9 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_mixed_sign_int8_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_mixed_sign_int8_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_mixed_sign_int8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_mixed_sign_int8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_mixed_sign_int8/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_mixed_sign_int8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_mixed_sign_int8_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_uint16_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_uint16_xnnpack.cc new file mode 100644 index 000000000..245d0caa0 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_uint16_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint16_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint16/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint16/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint16/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint16/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_uint16 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint16_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_uint32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_uint32_xnnpack.cc new file mode 100644 index 000000000..0e0d177a2 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_uint32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_uint64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_uint64_xnnpack.cc new file mode 100644 index 000000000..56e44aeb9 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_uint64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_mod_uint8_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_mod_uint8_xnnpack.cc new file mode 100644 index 000000000..12cc7ddb7 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_mod_uint8_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_mod_uint8_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_mod_uint8/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_mod_uint8/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_mod_uint8/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_mod_uint8/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_mod_uint8 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_mod_uint8_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_momentum_multiple_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_momentum_multiple_xnnpack.cc new file mode 100644 index 000000000..1d025d824 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_momentum_multiple_xnnpack.cc @@ -0,0 +1,39 @@ +//===-test_momentum_multiple_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_5.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_5.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_6.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_6.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum_multiple/test_data_set_0/input_7.cc -x onnx -emit-data-as-c %data_path/test_momentum_multiple/test_data_set_0/input_7.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_momentum_multiple/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_momentum_multiple/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_momentum_multiple | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_momentum_multiple_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_momentum_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_momentum_xnnpack.cc new file mode 100644 index 000000000..a6c5e6c09 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_momentum_xnnpack.cc @@ -0,0 +1,34 @@ +//===-test_momentum_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_momentum/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_momentum/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_momentum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_momentum/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_momentum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_momentum_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nesterov_momentum_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nesterov_momentum_xnnpack.cc new file mode 100644 index 000000000..ee4e63b17 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nesterov_momentum_xnnpack.cc @@ -0,0 +1,34 @@ +//===-test_nesterov_momentum_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nesterov_momentum/test_data_set_0/input_4.cc -x onnx -emit-data-as-c %data_path/test_nesterov_momentum/test_data_set_0/input_4.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nesterov_momentum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nesterov_momentum/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nesterov_momentum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nesterov_momentum_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NC_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NC_expanded_xnnpack.cc new file mode 100644 index 000000000..d9234fbf6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NC_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NC_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NC_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NC_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NC_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NC_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NC_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NC_xnnpack.cc new file mode 100644 index 000000000..7b687ba03 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NC_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NC_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NC/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NC/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NC/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NC/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NC | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NC_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_expanded_xnnpack.cc new file mode 100644 index 000000000..ea79fb09a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..1ccca263b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_ii_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_ii_xnnpack.cc new file mode 100644 index 000000000..da865c9cc --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_ii_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..fc14511fa --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1_mean_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_mean_weight_negative_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_mean_weight_negative_ii_xnnpack.cc new file mode 100644 index 000000000..90b4838bc --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_mean_weight_negative_ii_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_mean_weight_negative_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_mean_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_mean_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1_mean_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_mean_weight_negative_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_expanded_xnnpack.cc new file mode 100644 index 000000000..800e7fe9e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..027db788a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_ii_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_ii_xnnpack.cc new file mode 100644 index 000000000..9ac0a8226 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_ii_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_xnnpack.cc new file mode 100644 index 000000000..c20825bab --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_weight_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1_weight_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1_weight/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_weight_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_xnnpack.cc new file mode 100644 index 000000000..1e6f85427 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_expanded_xnnpack.cc new file mode 100644 index 000000000..8622b3b19 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..45f3c0548 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_xnnpack.cc new file mode 100644 index 000000000..87100872e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_no_weight_reduction_mean_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_no_weight_reduction_mean_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_no_weight_reduction_mean_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_mean_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_mean_expanded_xnnpack.cc new file mode 100644 index 000000000..1406c7465 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_mean_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_mean_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_reduction_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_mean_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_mean_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_mean_xnnpack.cc new file mode 100644 index 000000000..fd06c5929 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_mean_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_mean_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_mean/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_reduction_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_mean_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_sum_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_sum_expanded_xnnpack.cc new file mode 100644 index 000000000..ce71d11f8 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_sum_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_sum_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_reduction_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_sum_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_sum_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_sum_xnnpack.cc new file mode 100644 index 000000000..f10337b7a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_reduction_sum_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_reduction_sum_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_reduction_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_reduction_sum/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_reduction_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_reduction_sum_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_expanded_xnnpack.cc new file mode 100644 index 000000000..4cce74b36 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_with_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_xnnpack.cc new file mode 100644 index 000000000..7b8f7fd4a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_mean_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_mean_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_mean_xnnpack.cc new file mode 100644 index 000000000..187373ffa --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_mean_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_mean_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_mean/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_with_weight_reduction_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_mean_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_xnnpack.cc new file mode 100644 index 000000000..c78af539e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..38f81be1c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_xnnpack.cc new file mode 100644 index 000000000..290e3c85e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_xnnpack.cc new file mode 100644 index 000000000..d77b41737 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_reduction_sum_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_reduction_sum_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight_reduction_sum/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_with_weight_reduction_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_reduction_sum_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_xnnpack.cc new file mode 100644 index 000000000..8edffeb23 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_with_weight_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2_with_weight_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2_with_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2_with_weight/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2_with_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_with_weight_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_xnnpack.cc new file mode 100644 index 000000000..b1eb14fd9 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..44cf77e35 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc new file mode 100644 index 000000000..ff846f2fb --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2d3_none_no_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..8eb305bd8 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_sum_weight_high_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_sum_weight_high_ii_xnnpack.cc new file mode 100644 index 000000000..539becb8e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3_sum_weight_high_ii_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3_sum_weight_high_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2d3_sum_weight_high_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3_sum_weight_high_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc new file mode 100644 index 000000000..9cf35a1fe --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_mean_weight_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_mean_weight_xnnpack.cc new file mode 100644 index 000000000..79bd89e0a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_mean_weight_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_nllloss_NCd1d2d3d4d5_mean_weight_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_mean_weight/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2d3d4d5_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_mean_weight_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc new file mode 100644 index 000000000..1be2a535c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_none_no_weight_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_none_no_weight_xnnpack.cc new file mode 100644 index 000000000..57e48e7b3 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_nllloss_NCd1d2d3d4d5_none_no_weight_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_nllloss_NCd1d2d3d4d5_none_no_weight_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_nllloss_NCd1d2d3d4d5_none_no_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_nllloss_NCd1d2d3d4d5_none_no_weight_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_onehot_negative_indices_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_onehot_negative_indices_xnnpack.cc new file mode 100644 index 000000000..234627661 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_onehot_negative_indices_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_onehot_negative_indices_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_negative_indices/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_onehot_negative_indices/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_onehot_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_onehot_negative_indices/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_onehot_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_onehot_negative_indices_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_onehot_with_negative_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_onehot_with_negative_axis_xnnpack.cc new file mode 100644 index 000000000..01e0eedd9 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_onehot_with_negative_axis_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_onehot_with_negative_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_onehot_with_negative_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_onehot_with_negative_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_onehot_with_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_onehot_with_negative_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_onehot_with_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_onehot_with_negative_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_int32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_int32_xnnpack.cc new file mode 100644 index 000000000..706919c1b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_int32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_int32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_int32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_pow_types_float32_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_int32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_int64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_int64_xnnpack.cc new file mode 100644 index 000000000..193f6cf27 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_int64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_int64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_int64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_pow_types_float32_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_int64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_uint32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_uint32_xnnpack.cc new file mode 100644 index 000000000..db6057a99 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_uint32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_uint32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_uint32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_uint32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_pow_types_float32_uint32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_uint32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_uint64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_uint64_xnnpack.cc new file mode 100644 index 000000000..96c29f06e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float32_uint64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float32_uint64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float32_uint64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float32_uint64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float32_uint64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float32_uint64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_pow_types_float32_uint64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float32_uint64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float_xnnpack.cc new file mode 100644 index 000000000..33b28034c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_float_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_float_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_float/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_float/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_float/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_float/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_pow_types_float | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_float_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int32_float32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int32_float32_xnnpack.cc new file mode 100644 index 000000000..c51e8915a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int32_float32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int32_float32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int32_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int32_float32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_pow_types_int32_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int32_float32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int32_int32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int32_int32_xnnpack.cc new file mode 100644 index 000000000..d71108ea0 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int32_int32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int32_int32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int32_int32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int32_int32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int32_int32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int32_int32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_pow_types_int32_int32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int32_int32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int64_float32_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int64_float32_xnnpack.cc new file mode 100644 index 000000000..5671ee097 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int64_float32_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int64_float32_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_float32/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_float32/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int64_float32/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int64_float32/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_pow_types_int64_float32 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int64_float32_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int64_int64_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int64_int64_xnnpack.cc new file mode 100644 index 000000000..7db7c17ff --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int64_int64_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int64_int64_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int64_int64/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int64_int64/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int64_int64/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int64_int64/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_pow_types_int64_int64 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int64_int64_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int_xnnpack.cc new file mode 100644 index 000000000..6742d30b1 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_pow_types_int_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_pow_types_int_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_pow_types_int/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_pow_types_int/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_pow_types_int/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_pow_types_int/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_pow_types_int | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_pow_types_int_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_quantizelinear_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_quantizelinear_axis_xnnpack.cc new file mode 100644 index 000000000..40dd07b97 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_quantizelinear_axis_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_quantizelinear_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_quantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_quantizelinear_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_quantizelinear_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_quantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_quantizelinear_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_quantizelinear_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_range_float_type_positive_delta_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_range_float_type_positive_delta_expanded_xnnpack.cc new file mode 100644 index 000000000..3e28e3527 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_range_float_type_positive_delta_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_range_float_type_positive_delta_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_float_type_positive_delta_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_float_type_positive_delta_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_range_float_type_positive_delta_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_float_type_positive_delta_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_range_float_type_positive_delta_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_range_float_type_positive_delta_xnnpack.cc new file mode 100644 index 000000000..66ae7ce8a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_range_float_type_positive_delta_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_range_float_type_positive_delta_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_float_type_positive_delta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_float_type_positive_delta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_float_type_positive_delta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_float_type_positive_delta/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_range_float_type_positive_delta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_float_type_positive_delta_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_range_int32_type_negative_delta_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_range_int32_type_negative_delta_expanded_xnnpack.cc new file mode 100644 index 000000000..30d61037a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_range_int32_type_negative_delta_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_range_int32_type_negative_delta_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_int32_type_negative_delta_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_int32_type_negative_delta_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_range_int32_type_negative_delta_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_int32_type_negative_delta_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_range_int32_type_negative_delta_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_range_int32_type_negative_delta_xnnpack.cc new file mode 100644 index 000000000..6edbd6a95 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_range_int32_type_negative_delta_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_range_int32_type_negative_delta_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_range_int32_type_negative_delta/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_range_int32_type_negative_delta/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_range_int32_type_negative_delta/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_range_int32_type_negative_delta | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_range_int32_type_negative_delta_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_l1_negative_axes_keep_dims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_l1_negative_axes_keep_dims_example_xnnpack.cc new file mode 100644 index 000000000..d4180f7ec --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_l1_negative_axes_keep_dims_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l1_negative_axes_keep_dims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l1_negative_axes_keep_dims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l1_negative_axes_keep_dims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_l1_negative_axes_keep_dims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l1_negative_axes_keep_dims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_l1_negative_axes_keep_dims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_l1_negative_axes_keep_dims_random_xnnpack.cc new file mode 100644 index 000000000..66437ced4 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_l1_negative_axes_keep_dims_random_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l1_negative_axes_keep_dims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l1_negative_axes_keep_dims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l1_negative_axes_keep_dims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_l1_negative_axes_keep_dims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l1_negative_axes_keep_dims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_l2_negative_axes_keep_dims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_l2_negative_axes_keep_dims_example_xnnpack.cc new file mode 100644 index 000000000..51b8fec3a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_l2_negative_axes_keep_dims_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l2_negative_axes_keep_dims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l2_negative_axes_keep_dims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l2_negative_axes_keep_dims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_l2_negative_axes_keep_dims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l2_negative_axes_keep_dims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_l2_negative_axes_keep_dims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_l2_negative_axes_keep_dims_random_xnnpack.cc new file mode 100644 index 000000000..f8e0f327c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_l2_negative_axes_keep_dims_random_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_l2_negative_axes_keep_dims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_l2_negative_axes_keep_dims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_l2_negative_axes_keep_dims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_l2_negative_axes_keep_dims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_l2_negative_axes_keep_dims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_exp_negative_axes_keepdims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_exp_negative_axes_keepdims_example_xnnpack.cc new file mode 100644 index 000000000..cd669f839 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_exp_negative_axes_keepdims_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_exp_negative_axes_keepdims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_exp_negative_axes_keepdims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_exp_negative_axes_keepdims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_exp_negative_axes_keepdims_random_xnnpack.cc new file mode 100644 index 000000000..e6f729341 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_exp_negative_axes_keepdims_random_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_exp_negative_axes_keepdims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_log_sum_exp_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_exp_negative_axes_keepdims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_negative_axes_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_negative_axes_xnnpack.cc new file mode 100644 index 000000000..792066d49 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_log_sum_negative_axes_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_log_sum_negative_axes_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_log_sum_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_log_sum_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_log_sum_negative_axes/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_log_sum_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_log_sum_negative_axes_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_max_negative_axes_keepdims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_max_negative_axes_keepdims_example_xnnpack.cc new file mode 100644 index 000000000..bb654f642 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_max_negative_axes_keepdims_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_max_negative_axes_keepdims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_max_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_max_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_max_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_max_negative_axes_keepdims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_max_negative_axes_keepdims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_max_negative_axes_keepdims_random_xnnpack.cc new file mode 100644 index 000000000..dd4b26001 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_max_negative_axes_keepdims_random_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_max_negative_axes_keepdims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_max_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_max_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_max_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_max_negative_axes_keepdims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_mean_negative_axes_keepdims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_mean_negative_axes_keepdims_example_xnnpack.cc new file mode 100644 index 000000000..b80bb5694 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_mean_negative_axes_keepdims_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_mean_negative_axes_keepdims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_mean_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_mean_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_mean_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_mean_negative_axes_keepdims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_mean_negative_axes_keepdims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_mean_negative_axes_keepdims_random_xnnpack.cc new file mode 100644 index 000000000..94f6ca105 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_mean_negative_axes_keepdims_random_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_mean_negative_axes_keepdims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_mean_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_mean_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_mean_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_mean_negative_axes_keepdims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_min_negative_axes_keepdims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_min_negative_axes_keepdims_example_xnnpack.cc new file mode 100644 index 000000000..43e1dbd7c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_min_negative_axes_keepdims_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_min_negative_axes_keepdims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_min_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_min_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_min_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_min_negative_axes_keepdims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_min_negative_axes_keepdims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_min_negative_axes_keepdims_random_xnnpack.cc new file mode 100644 index 000000000..aa67c4ca3 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_min_negative_axes_keepdims_random_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_min_negative_axes_keepdims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_min_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_min_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_min_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_min_negative_axes_keepdims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_prod_negative_axes_keepdims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_prod_negative_axes_keepdims_example_xnnpack.cc new file mode 100644 index 000000000..a88810390 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_prod_negative_axes_keepdims_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_prod_negative_axes_keepdims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_prod_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_prod_negative_axes_keepdims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_prod_negative_axes_keepdims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_prod_negative_axes_keepdims_random_xnnpack.cc new file mode 100644 index 000000000..69581794b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_prod_negative_axes_keepdims_random_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_prod_negative_axes_keepdims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_prod_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_prod_negative_axes_keepdims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_empty_axes_input_noop_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_empty_axes_input_noop_example_xnnpack.cc new file mode 100644 index 000000000..2e115e375 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_empty_axes_input_noop_example_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_empty_axes_input_noop_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_empty_axes_input_noop_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_empty_axes_input_noop_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_sum_empty_axes_input_noop_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_empty_axes_input_noop_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_empty_axes_input_noop_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_empty_axes_input_noop_random_xnnpack.cc new file mode 100644 index 000000000..15f3f1ad3 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_empty_axes_input_noop_random_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_empty_axes_input_noop_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_empty_axes_input_noop_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_empty_axes_input_noop_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_sum_empty_axes_input_noop_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_empty_axes_input_noop_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_negative_axes_keepdims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_negative_axes_keepdims_example_xnnpack.cc new file mode 100644 index 000000000..6f471fb09 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_negative_axes_keepdims_example_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_negative_axes_keepdims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_sum_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_negative_axes_keepdims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_negative_axes_keepdims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_negative_axes_keepdims_random_xnnpack.cc new file mode 100644 index 000000000..a94d6137c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_negative_axes_keepdims_random_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_reduce_sum_negative_axes_keepdims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_sum_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_negative_axes_keepdims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_square_negative_axes_keepdims_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_square_negative_axes_keepdims_example_xnnpack.cc new file mode 100644 index 000000000..8193dd33e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_square_negative_axes_keepdims_example_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_sum_square_negative_axes_keepdims_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_square_negative_axes_keepdims_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_square_negative_axes_keepdims_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_sum_square_negative_axes_keepdims_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_square_negative_axes_keepdims_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_square_negative_axes_keepdims_random_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_square_negative_axes_keepdims_random_xnnpack.cc new file mode 100644 index 000000000..ea8c7b192 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reduce_sum_square_negative_axes_keepdims_random_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_reduce_sum_square_negative_axes_keepdims_random_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_sum_square_negative_axes_keepdims_random/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_sum_square_negative_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reduce_sum_square_negative_axes_keepdims_random | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reduce_sum_square_negative_axes_keepdims_random_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reshape_negative_extended_dims_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reshape_negative_extended_dims_xnnpack.cc new file mode 100644 index 000000000..59aaf0d18 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reshape_negative_extended_dims_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_reshape_negative_extended_dims_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_negative_extended_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_negative_extended_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_negative_extended_dims/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reshape_negative_extended_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_negative_extended_dims_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reshape_reordered_all_dims_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reshape_reordered_all_dims_xnnpack.cc new file mode 100644 index 000000000..4392deb09 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reshape_reordered_all_dims_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_reshape_reordered_all_dims_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_all_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_reordered_all_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_reordered_all_dims/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reshape_reordered_all_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_reordered_all_dims_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reshape_reordered_last_dims_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reshape_reordered_last_dims_xnnpack.cc new file mode 100644 index 000000000..e9c95887b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reshape_reordered_last_dims_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_reshape_reordered_last_dims_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_reordered_last_dims/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_reordered_last_dims/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_reordered_last_dims/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reshape_reordered_last_dims | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_reordered_last_dims_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reshape_zero_and_negative_dim_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reshape_zero_and_negative_dim_xnnpack.cc new file mode 100644 index 000000000..7b1f44c34 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reshape_zero_and_negative_dim_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_reshape_zero_and_negative_dim_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_and_negative_dim/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_zero_and_negative_dim/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_zero_and_negative_dim/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reshape_zero_and_negative_dim | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_zero_and_negative_dim_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_reshape_zero_dim_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_reshape_zero_dim_xnnpack.cc new file mode 100644 index 000000000..9d763b491 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_reshape_zero_dim_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_reshape_zero_dim_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_reshape_zero_dim/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_reshape_zero_dim/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reshape_zero_dim/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reshape_zero_dim/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_reshape_zero_dim | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_reshape_zero_dim_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc new file mode 100644 index 000000000..cee4b928b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_downsample_scales_cubic_A_n0p5_exclude_outside | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_align_corners_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_align_corners_xnnpack.cc new file mode 100644 index 000000000..6dc37b16d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_align_corners_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_align_corners_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic_align_corners/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_downsample_scales_cubic_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_align_corners_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_xnnpack.cc new file mode 100644 index 000000000..f11dd3aff --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_cubic_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_cubic_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_cubic/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_downsample_scales_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_cubic_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_linear_align_corners_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_linear_align_corners_xnnpack.cc new file mode 100644 index 000000000..c594810a6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_linear_align_corners_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_linear_align_corners_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_linear_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_linear_align_corners/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_downsample_scales_linear_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_linear_align_corners_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_linear_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_linear_xnnpack.cc new file mode 100644 index 000000000..5ae391ee7 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_linear_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_linear_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_linear/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_linear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_linear/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_downsample_scales_linear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_linear_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_nearest_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_nearest_xnnpack.cc new file mode 100644 index 000000000..ea066748c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_scales_nearest_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_scales_nearest_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_scales_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_scales_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_scales_nearest/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_downsample_scales_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_scales_nearest_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_cubic_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_cubic_xnnpack.cc new file mode 100644 index 000000000..1e1f15494 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_cubic_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_cubic_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_cubic/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_downsample_sizes_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_cubic_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_linear_pytorch_half_pixel_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_linear_pytorch_half_pixel_xnnpack.cc new file mode 100644 index 000000000..d7e9a79e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_linear_pytorch_half_pixel_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_linear_pytorch_half_pixel_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_downsample_sizes_linear_pytorch_half_pixel | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_linear_pytorch_half_pixel_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_xnnpack.cc new file mode 100644 index 000000000..cb7286b3e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_nearest_tf_half_pixel_for_nn_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_nearest_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_nearest_xnnpack.cc new file mode 100644 index 000000000..9fb85e411 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_downsample_sizes_nearest_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_downsample_sizes_nearest_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_downsample_sizes_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_downsample_sizes_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_downsample_sizes_nearest/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_downsample_sizes_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_downsample_sizes_nearest_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_tf_crop_and_resize_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_tf_crop_and_resize_xnnpack.cc new file mode 100644 index 000000000..0157abfc1 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_tf_crop_and_resize_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_resize_tf_crop_and_resize_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_resize_tf_crop_and_resize/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_tf_crop_and_resize/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_tf_crop_and_resize/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_tf_crop_and_resize | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_tf_crop_and_resize_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc new file mode 100644 index 000000000..f681cf407 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_scales_cubic_A_n0p5_exclude_outside | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_A_n0p5_exclude_outside_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_align_corners_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_align_corners_xnnpack.cc new file mode 100644 index 000000000..3ed34b465 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_align_corners_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_align_corners_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_align_corners/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_scales_cubic_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_align_corners_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_asymmetric_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_asymmetric_xnnpack.cc new file mode 100644 index 000000000..677eab8b0 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_asymmetric_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_asymmetric_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic_asymmetric/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic_asymmetric/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_scales_cubic_asymmetric | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_asymmetric_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_xnnpack.cc new file mode 100644 index 000000000..b79dfaa68 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_cubic_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_cubic_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_cubic/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_scales_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_cubic_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_linear_align_corners_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_linear_align_corners_xnnpack.cc new file mode 100644 index 000000000..bcbe2bf78 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_linear_align_corners_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_linear_align_corners_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_linear_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_linear_align_corners/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_scales_linear_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_linear_align_corners_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_linear_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_linear_xnnpack.cc new file mode 100644 index 000000000..d4adc771e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_linear_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_linear_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_linear/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_linear/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_linear/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_scales_linear | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_linear_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_nearest_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_nearest_xnnpack.cc new file mode 100644 index 000000000..032851aac --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_scales_nearest_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_scales_nearest_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_scales_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_scales_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_scales_nearest/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_scales_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_scales_nearest_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_cubic_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_cubic_xnnpack.cc new file mode 100644 index 000000000..faa49df7d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_cubic_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_cubic_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_cubic/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_cubic/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_cubic/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_sizes_cubic | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_cubic_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_ceil_half_pixel_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_ceil_half_pixel_xnnpack.cc new file mode 100644 index 000000000..5284cfa71 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_ceil_half_pixel_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_ceil_half_pixel_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_sizes_nearest_ceil_half_pixel | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_ceil_half_pixel_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_floor_align_corners_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_floor_align_corners_xnnpack.cc new file mode 100644 index 000000000..a2bfe1ff4 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_floor_align_corners_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_floor_align_corners_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_floor_align_corners/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_floor_align_corners/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_sizes_nearest_floor_align_corners | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_floor_align_corners_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_xnnpack.cc new file mode 100644 index 000000000..f324453dd --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_xnnpack.cc new file mode 100644 index 000000000..0015b5f36 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_resize_upsample_sizes_nearest_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_resize_upsample_sizes_nearest_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_resize_upsample_sizes_nearest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_resize_upsample_sizes_nearest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_resize_upsample_sizes_nearest/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_resize_upsample_sizes_nearest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_resize_upsample_sizes_nearest_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_round_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_round_xnnpack.cc new file mode 100644 index 000000000..b7c8a0f91 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_round_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_round_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_round/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_round/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_round/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_round/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_round/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_round/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_round | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_round_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_with_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_with_axis_xnnpack.cc new file mode 100644 index 000000000..7dff1e264 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_with_axis_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_with_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_with_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_with_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_scatter_elements_with_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_with_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_with_negative_indices_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_with_negative_indices_xnnpack.cc new file mode 100644 index 000000000..caa6e2df4 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_with_negative_indices_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_with_negative_indices_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_with_negative_indices/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_with_negative_indices/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_with_negative_indices/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_scatter_elements_with_negative_indices | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_with_negative_indices_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_without_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_without_axis_xnnpack.cc new file mode 100644 index 000000000..1e115608e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_scatter_elements_without_axis_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_scatter_elements_without_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatter_elements_without_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatter_elements_without_axis/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatter_elements_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatter_elements_without_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_scatter_elements_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatter_elements_without_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_scatternd_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_scatternd_xnnpack.cc new file mode 100644 index 000000000..9f7d34298 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_scatternd_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_scatternd_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_scatternd/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_scatternd/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_scatternd/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_scatternd/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_scatternd | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_scatternd_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..a225b9662 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1_mean_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..95b288b1f --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_log_prob_xnnpack.cc new file mode 100644 index 000000000..a49fd1430 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_log_prob_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1_mean_weight_negative_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_xnnpack.cc new file mode 100644 index 000000000..78e11e461 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1_mean_weight_negative_ii_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1_mean_weight_negative_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1_mean_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1_mean_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1_mean_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1_mean_weight_negative_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..062fd0cde --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..fe74b436d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_xnnpack.cc new file mode 100644 index 000000000..c258d628c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc new file mode 100644 index 000000000..db4f64727 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3_none_no_weight_negative_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_none_no_weight_negative_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..435438077 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..28442c3aa --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_xnnpack.cc new file mode 100644 index 000000000..b421c5114 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3_sum_weight_high_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_xnnpack.cc new file mode 100644 index 000000000..d295be4e8 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3_sum_weight_high_ii_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3_sum_weight_high_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3_sum_weight_high_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3_sum_weight_high_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3_sum_weight_high_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3_sum_weight_high_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc new file mode 100644 index 000000000..2e9ea92d3 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3d4d5_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..9599a32e2 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_xnnpack.cc new file mode 100644 index 000000000..84392e2fb --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_log_prob_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3d4d5_mean_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_xnnpack.cc new file mode 100644 index 000000000..c8362fd5d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_mean_weight_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_mean_weight_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_mean_weight/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3d4d5_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_mean_weight_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc new file mode 100644 index 000000000..94a138b21 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..51c110814 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_xnnpack.cc new file mode 100644 index 000000000..b4ad3cec6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3d4d5_none_no_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_xnnpack.cc new file mode 100644 index 000000000..f3781a4f1 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_NCd1d2d3d4d5_none_no_weight_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_NCd1d2d3d4d5_none_no_weight_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_NCd1d2d3d4d5_none_no_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_NCd1d2d3d4d5_none_no_weight/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_NCd1d2d3d4d5_none_no_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_NCd1d2d3d4d5_none_no_weight_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_expanded_xnnpack.cc new file mode 100644 index 000000000..472327854 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_3d_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..cb58a0108 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_log_prob_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_3d_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_log_prob_xnnpack.cc new file mode 100644 index 000000000..497d64326 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_log_prob_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_3d_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_xnnpack.cc new file mode 100644 index 000000000..c106d7787 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_3d_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_3d_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_3d/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_3d_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_expanded_xnnpack.cc new file mode 100644 index 000000000..f96144c77 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..3477e7a4f --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_log_prob_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_log_prob_xnnpack.cc new file mode 100644 index 000000000..dabe9d025 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_log_prob_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_expanded_xnnpack.cc new file mode 100644 index 000000000..91a3d9935 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_3d_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..17e2ac739 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_log_prob_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_3d_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_log_prob_xnnpack.cc new file mode 100644 index 000000000..6a0f35cbc --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_log_prob_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_3d_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_xnnpack.cc new file mode 100644 index 000000000..d3a516cd6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_3d_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_3d_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_3d/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_3d_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_expanded_xnnpack.cc new file mode 100644 index 000000000..d8b57abf9 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_4d_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_4d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..c3835bbf7 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_log_prob_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_4d_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_4d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_log_prob_xnnpack.cc new file mode 100644 index 000000000..0963f1422 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_log_prob_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_4d_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_4d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_xnnpack.cc new file mode 100644 index 000000000..a7f3a4377 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_4d_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_4d_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_4d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_4d/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_4d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_4d_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..f49fb298a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..6da54dcec --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_log_prob_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_log_prob_xnnpack.cc new file mode 100644 index 000000000..639585d9d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_log_prob_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_no_weight_ii_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_xnnpack.cc new file mode 100644 index 000000000..346bf6195 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_no_weight_ii_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_no_weight_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_no_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_no_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_no_weight_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_no_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_no_weight_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_expanded_xnnpack.cc new file mode 100644 index 000000000..cf8a6dd75 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_expanded_xnnpack.cc new file mode 100644 index 000000000..cac34d384 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_3d_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_3d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..3efe08ceb --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_log_prob_expanded_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_3d_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_3d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_log_prob_xnnpack.cc new file mode 100644 index 000000000..46df8a170 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_log_prob_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_3d_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_3d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_xnnpack.cc new file mode 100644 index 000000000..bc79923a9 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_3d_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_3d_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_3d/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_3d/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_3d_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_expanded_xnnpack.cc new file mode 100644 index 000000000..35fcdf9d1 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_4d_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_4d_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..1ab6c7bc8 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_log_prob_expanded_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_4d_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_4d_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_log_prob_xnnpack.cc new file mode 100644 index 000000000..6188261c9 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_log_prob_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_4d_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_4d_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_xnnpack.cc new file mode 100644 index 000000000..19070e97b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_4d_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_4d_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_4d/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_4d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_4d/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_4d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_4d_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_expanded_xnnpack.cc new file mode 100644 index 000000000..91cb8f635 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..49f1d599d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_log_prob_expanded_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_log_prob_xnnpack.cc new file mode 100644 index 000000000..caa6dfcf7 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_log_prob_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_ii_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_xnnpack.cc new file mode 100644 index 000000000..dc39a3e23 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_ii_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_ii_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_ii/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_ii/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_ii/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_ii/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_ii | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_ii_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..0cc519c72 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_log_prob_expanded_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_log_prob_xnnpack.cc new file mode 100644 index 000000000..fc0a2adb6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_log_prob_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_mean_weight_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_xnnpack.cc new file mode 100644 index 000000000..c8043d37a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_weight_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_mean_weight_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean_weight/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_mean_weight/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean_weight/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean_weight/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean_weight | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_weight_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_xnnpack.cc new file mode 100644 index 000000000..e6c7f1630 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_mean_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_mean_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_mean/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_mean/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_mean/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_mean/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_mean | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_mean_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_none_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_expanded_xnnpack.cc new file mode 100644 index 000000000..10d481d57 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_none_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_none_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_none_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..34f49a1e9 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_log_prob_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_none_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_none_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_log_prob_xnnpack.cc new file mode 100644 index 000000000..05fceb30a --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_log_prob_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_none_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_expanded_xnnpack.cc new file mode 100644 index 000000000..64b5b3f5d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_weights_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_none_weights_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..cb4033d3b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_log_prob_expanded_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_none_weights_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_none_weights_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_log_prob_xnnpack.cc new file mode 100644 index 000000000..cb8ade486 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_log_prob_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_sce_none_weights_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights_log_prob/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_none_weights_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_xnnpack.cc new file mode 100644 index 000000000..d4298f8fd --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_weights_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_none_weights_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none_weights/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sce_none_weights/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none_weights/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none_weights/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_none_weights | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_weights_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_none_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_xnnpack.cc new file mode 100644 index 000000000..ce6d6dece --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_none_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_none_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_none/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_none/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_none/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_none/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_none | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_none_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_expanded_xnnpack.cc new file mode 100644 index 000000000..7b1428067 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_expanded_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_sum_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_sum_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_log_prob_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_log_prob_expanded_xnnpack.cc new file mode 100644 index 000000000..d27a22a2f --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_log_prob_expanded_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_sum_log_prob_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob_expanded/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_log_prob_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_log_prob_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_sum_log_prob_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_log_prob_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_log_prob_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_log_prob_xnnpack.cc new file mode 100644 index 000000000..53a404792 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_log_prob_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sce_sum_log_prob_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum_log_prob/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum_log_prob/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum_log_prob/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum_log_prob/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_sum_log_prob | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_log_prob_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_xnnpack.cc new file mode 100644 index 000000000..6c373fc1c --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sce_sum_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sce_sum_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sce_sum/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sce_sum/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sce_sum/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sce_sum/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sce_sum | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sce_sum_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sequence_insert_at_back_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sequence_insert_at_back_xnnpack.cc new file mode 100644 index 000000000..86f4cc76d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sequence_insert_at_back_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_sequence_insert_at_back_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_back/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_back/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sequence_insert_at_back/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sequence_insert_at_back/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sequence_insert_at_back | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sequence_insert_at_back_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_sequence_insert_at_front_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_sequence_insert_at_front_xnnpack.cc new file mode 100644 index 000000000..80bc712af --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_sequence_insert_at_front_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_sequence_insert_at_front_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_sequence_insert_at_front/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_sequence_insert_at_front/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_sequence_insert_at_front/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_sequence_insert_at_front/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_sequence_insert_at_front | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_sequence_insert_at_front_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_slice_negative_axes_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_slice_negative_axes_xnnpack.cc new file mode 100644 index 000000000..639b9f564 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_slice_negative_axes_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_slice_negative_axes_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_slice_negative_axes/test_data_set_0/input_3.cc -x onnx -emit-data-as-c %data_path/test_slice_negative_axes/test_data_set_0/input_3.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_slice_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_slice_negative_axes/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_slice_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_slice_negative_axes_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_0_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_0_expanded_xnnpack.cc new file mode 100644 index 000000000..018b777fb --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_0_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_0_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_0_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_0_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_0_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_0_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_0_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_0_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_softmax_axis_0_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_0_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_1_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_1_expanded_xnnpack.cc new file mode 100644 index 000000000..58ee294e6 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_1_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_1_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_1_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_1_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_1_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_1_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_1_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_1_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_softmax_axis_1_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_1_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_2_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_2_expanded_xnnpack.cc new file mode 100644 index 000000000..e1db6655f --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_softmax_axis_2_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_softmax_axis_2_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_2_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_2_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_axis_2_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_axis_2_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_axis_2_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_axis_2_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_softmax_axis_2_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_axis_2_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_softmax_default_axis_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_softmax_default_axis_expanded_xnnpack.cc new file mode 100644 index 000000000..4b1f02121 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_softmax_default_axis_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_softmax_default_axis_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_default_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_default_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_default_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_default_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_default_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_default_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_softmax_default_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_default_axis_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_softmax_example_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_softmax_example_expanded_xnnpack.cc new file mode 100644 index 000000000..409c232ab --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_softmax_example_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_softmax_example_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_example_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_example_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_example_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_example_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_example_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_example_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_softmax_example_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_example_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_softmax_large_number_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_softmax_large_number_expanded_xnnpack.cc new file mode 100644 index 000000000..7127bfc67 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_softmax_large_number_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_softmax_large_number_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_large_number_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_large_number_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_large_number_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_large_number_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_large_number_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_large_number_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_softmax_large_number_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_large_number_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_softmax_negative_axis_expanded_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_softmax_negative_axis_expanded_xnnpack.cc new file mode 100644 index 000000000..1606673cb --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_softmax_negative_axis_expanded_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_softmax_negative_axis_expanded_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis_expanded/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis_expanded/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis_expanded/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis_expanded/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_negative_axis_expanded/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_negative_axis_expanded/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_softmax_negative_axis_expanded | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_negative_axis_expanded_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_softmax_negative_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_softmax_negative_axis_xnnpack.cc new file mode 100644 index 000000000..4054f7767 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_softmax_negative_axis_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_softmax_negative_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_softmax_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_softmax_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_softmax_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_softmax_negative_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_softmax_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_softmax_negative_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_split_zero_size_splits_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_split_zero_size_splits_xnnpack.cc new file mode 100644 index 000000000..e1d3517a4 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_split_zero_size_splits_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_split_zero_size_splits_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_split_zero_size_splits/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_split_zero_size_splits/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_split_zero_size_splits/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_split_zero_size_splits/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_split_zero_size_splits | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_split_zero_size_splits_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_squeeze_negative_axes_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_squeeze_negative_axes_xnnpack.cc new file mode 100644 index 000000000..af13a6234 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_squeeze_negative_axes_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_squeeze_negative_axes_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_squeeze_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_squeeze_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_squeeze_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_squeeze_negative_axes/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_squeeze_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_squeeze_negative_axes_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_top_k_negative_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_top_k_negative_axis_xnnpack.cc new file mode 100644 index 000000000..c8ca70467 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_top_k_negative_axis_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_top_k_negative_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_negative_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_negative_axis/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_top_k_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_top_k_negative_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_top_k_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_top_k_negative_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_top_k_smallest_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_top_k_smallest_xnnpack.cc new file mode 100644 index 000000000..f24450870 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_top_k_smallest_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_top_k_smallest_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_top_k_smallest/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_top_k_smallest/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_top_k_smallest/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_top_k_smallest/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_top_k_smallest | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_top_k_smallest_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_default_mask_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_default_mask_xnnpack.cc new file mode 100644 index 000000000..f78d69b85 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_default_mask_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_default_mask_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_default_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_default_mask/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_training_dropout_default_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_default_mask_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_default_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_default_xnnpack.cc new file mode 100644 index 000000000..10b1043f1 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_default_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_default_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_default/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_default/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_default/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_default/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_training_dropout_default | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_default_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_mask_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_mask_xnnpack.cc new file mode 100644 index 000000000..429bdf4fe --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_mask_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_mask_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_mask/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_training_dropout_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_mask_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_xnnpack.cc new file mode 100644 index 000000000..73bebaa97 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_training_dropout | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_zero_ratio_mask_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_zero_ratio_mask_xnnpack.cc new file mode 100644 index 000000000..47f0c969b --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_zero_ratio_mask_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_training_dropout_zero_ratio_mask_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio_mask/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_zero_ratio_mask/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_zero_ratio_mask/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_training_dropout_zero_ratio_mask | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_zero_ratio_mask_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_zero_ratio_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_zero_ratio_xnnpack.cc new file mode 100644 index 000000000..42b06a152 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_training_dropout_zero_ratio_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_training_dropout_zero_ratio_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_training_dropout_zero_ratio/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_training_dropout_zero_ratio/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_training_dropout_zero_ratio/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_training_dropout_zero_ratio | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_training_dropout_zero_ratio_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unique_not_sorted_without_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unique_not_sorted_without_axis_xnnpack.cc new file mode 100644 index 000000000..d570896bd --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unique_not_sorted_without_axis_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_unique_not_sorted_without_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_not_sorted_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_not_sorted_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_not_sorted_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_not_sorted_without_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unique_not_sorted_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_not_sorted_without_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_axis_3d_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_axis_3d_xnnpack.cc new file mode 100644 index 000000000..d13c7f4da --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_axis_3d_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_axis_3d_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis_3d/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_axis_3d/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_axis_3d/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unique_sorted_with_axis_3d | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_axis_3d_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_axis_xnnpack.cc new file mode 100644 index 000000000..f17bfe5e7 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_axis_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unique_sorted_with_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_negative_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_negative_axis_xnnpack.cc new file mode 100644 index 000000000..1b8764e7e --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_with_negative_axis_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_with_negative_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_with_negative_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_with_negative_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_with_negative_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unique_sorted_with_negative_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_with_negative_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_without_axis_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_without_axis_xnnpack.cc new file mode 100644 index 000000000..a164df4b2 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unique_sorted_without_axis_xnnpack.cc @@ -0,0 +1,32 @@ +//===-test_unique_sorted_without_axis_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_1.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_2.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_2.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/output_3.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/output_3.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unique_sorted_without_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unique_sorted_without_axis/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unique_sorted_without_axis/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unique_sorted_without_axis/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unique_sorted_without_axis | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unique_sorted_without_axis_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_0_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_0_xnnpack.cc new file mode 100644 index 000000000..0f5438632 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_0_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_0_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_0/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_0/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_0/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_0/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unsqueeze_axis_0 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_0_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_1_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_1_xnnpack.cc new file mode 100644 index 000000000..a3c219ca0 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_1_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_1_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_1/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_1/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_1/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_1/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unsqueeze_axis_1 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_1_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_2_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_2_xnnpack.cc new file mode 100644 index 000000000..a31d90fa7 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_2_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_axis_2_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_2/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_2/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_2/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_2/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unsqueeze_axis_2 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_2_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_3_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_3_xnnpack.cc new file mode 100644 index 000000000..1e26d4f76 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_axis_3_xnnpack.cc @@ -0,0 +1,29 @@ +//===-test_unsqueeze_axis_3_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_3/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_3/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_axis_3/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_axis_3/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_axis_3/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_axis_3/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unsqueeze_axis_3 | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_axis_3_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_negative_axes_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_negative_axes_xnnpack.cc new file mode 100644 index 000000000..9a1b3aaea --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_negative_axes_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_negative_axes_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_negative_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_negative_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_negative_axes/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unsqueeze_negative_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_negative_axes_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_three_axes_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_three_axes_xnnpack.cc new file mode 100644 index 000000000..2a6f3cb7d --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_three_axes_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_three_axes_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_three_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_three_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_three_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_three_axes/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unsqueeze_three_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_three_axes_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_two_axes_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_two_axes_xnnpack.cc new file mode 100644 index 000000000..379f9eb22 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_two_axes_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_two_axes_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_two_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_two_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_two_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_two_axes/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unsqueeze_two_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_two_axes_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_unsorted_axes_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_unsorted_axes_xnnpack.cc new file mode 100644 index 000000000..d2b8c45bb --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_unsqueeze_unsorted_axes_xnnpack.cc @@ -0,0 +1,30 @@ +//===-test_unsqueeze_unsorted_axes_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_unsqueeze_unsorted_axes/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_unsqueeze_unsorted_axes/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_unsqueeze_unsorted_axes/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_unsqueeze_unsorted_axes | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_unsqueeze_unsorted_axes_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/lit_cases/test_xnnpack/test_where_long_example_xnnpack.cc b/tests/unittests/lit_cases/test_xnnpack/test_where_long_example_xnnpack.cc new file mode 100644 index 000000000..4c95da8b5 --- /dev/null +++ b/tests/unittests/lit_cases/test_xnnpack/test_where_long_example_xnnpack.cc @@ -0,0 +1,31 @@ +//===-test_where_long_example_xnnpack.cc-----------------------------------------------------------===// +// +// Copyright (C) 2019-2020 Alibaba Group Holding Limited. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +// clang-format off +// Testing CXX Code Gen using ODLA API on xnnpack +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/output_0.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_1.pb +// RUN: %halo_compiler -target cxx -o %data_path/test_where_long_example/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_where_long_example/test_data_set_0/input_2.pb +// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_where_long_example/model.onnx -o %t.cc +// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include +// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_where_long_example/test_data_set_0 %odla_link %device_link -lodla_xnnpack -o %t_xnnpack.exe -Wno-deprecated-declarations +// RUN: %t_xnnpack.exe 0.0001 0 xnnpack %data_path/test_where_long_example | FileCheck %s +// CHECK: Result Pass +// clang-format on +// XFAIL: * +#include "test_where_long_example_xnnpack.cc.tmp.main.cc.in" diff --git a/tests/unittests/run_test.py b/tests/unittests/run_test.py index a4cad8264..0fd01f5e1 100644 --- a/tests/unittests/run_test.py +++ b/tests/unittests/run_test.py @@ -52,7 +52,7 @@ # download onnx op data def download_data(localdir): if not os.path.exists(localdir): - os.system('git clone -b rel-1.5.0 https://github.com/onnx/onnx.git') + os.system('git clone -b rel-1.8.0 https://github.com/onnx/onnx.git') os.system('cp -r onnx/onnx/backend/test/data/node ' + localdir) os.system('rm -rf onnx') @@ -375,8 +375,8 @@ def add_all_litcases(data_path, error_threshold, devices): data_path = os.path.join(build_dir, 'tests/unittests/data') download_data(data_path) - #devices = ['tensorrt'] - devices = [] + devices = ['tensorrt'] + #devices = [] devices.append('dnnl') devices.append('eigen') devices.append('xnnpack')