From ea80348ef330bd6415ec6dae45b99873710f812a Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Thu, 26 Sep 2019 16:55:49 +0100 Subject: COMPMID-2564 - Add CLGEMMNative example * Add gemm native example. * Update shell script to run gemm native example. Signed-off-by: SiCong Li Change-Id: I0252f556b6f94adb776b8cb84b45971f1eb317e4 Reviewed-on: https://review.mlplatform.org/c/1992 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas --- examples/gemm_tuner/benchmark_gemm_examples.sh | 37 +++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'examples/gemm_tuner/benchmark_gemm_examples.sh') diff --git a/examples/gemm_tuner/benchmark_gemm_examples.sh b/examples/gemm_tuner/benchmark_gemm_examples.sh index 7782b11f72..fd5f71df2b 100755 --- a/examples/gemm_tuner/benchmark_gemm_examples.sh +++ b/examples/gemm_tuner/benchmark_gemm_examples.sh @@ -29,9 +29,10 @@ set -u CMD=$( basename $0 ) # All supported strategy options -ALL_STRATEGY_OPTIONS=("reshaped_rhs_only" "reshaped") +ALL_STRATEGY_OPTIONS=("native" "reshaped_rhs_only" "reshaped") # Names of example binary for each strategy +EXAMPLE_BIN_NATIVE="benchmark_cl_gemm_native" EXAMPLE_BIN_RESHAPED_RHS_ONLY="benchmark_cl_gemm_reshaped_rhs_only" EXAMPLE_BIN_RESHAPED="benchmark_cl_gemm_reshaped" @@ -72,6 +73,38 @@ Gemm shape file: EOF } +####################################### +# Print gemm config file for native help message +# Globals: +# None +# Arguments: +# None +# Returns: +# None +####################################### +function help_gemm_config_file_native() { + cat >&2 << EOF +Gemm config file (Strategy native): + Gemm config file is a headerless csv file with fields separated by commas and commas only (there cannot be whitespaces + around each field). + A gemm config is a list of 4 positive integers and 2 boolean values interleave_rhs and transpose_rhs, with: + m0 - Number of rows processed by the matrix multiplication + n0 - Number of columns processed by the matrix multiplication + k0 - Number of partial accumulations performed by the matrix multiplication + + Only the following configurations of M0, N0 and K0 are currently supported: + M0 = 1, 2, 3, 4, 5, 6, 7, 8 + N0 = 2, 3, 4, 8, 16 + K0 = 2, 3, 4, 8, 16 + + An example gemm config file looks like: + 1,4,4 + 2,3,8 + ... + +EOF +} + ####################################### # Print gemm config file for reshaped_rhs_only help message # Globals: @@ -195,6 +228,7 @@ Options: EOF # Print help messages about gemm shapes and various gemm configs $HELP && help_gemm_shape_file +$HELP && ( [ "${STRATEGY_OPTION}" == "" ] || [ "${STRATEGY_OPTION}" == "native" ] ) && help_gemm_config_file_native $HELP && ( [ "${STRATEGY_OPTION}" == "" ] || [ "${STRATEGY_OPTION}" == "reshaped_rhs_only" ] ) && help_gemm_config_file_reshaped_rhs_only $HELP && ( [ "${STRATEGY_OPTION}" == "" ] || [ "${STRATEGY_OPTION}" == "reshaped" ] ) && help_gemm_config_file_reshaped exit 1 @@ -360,6 +394,7 @@ arr_contains "${STRATEGY_OPTION}" "${ALL_STRATEGY_OPTIONS[@]}" || mkdir ${OUT_DIR} # Run selected strategy with all configurations +[ "${STRATEGY_OPTION}" == "native" ] && run $EXAMPLE_BIN_NATIVE [ "${STRATEGY_OPTION}" == "reshaped_rhs_only" ] && run $EXAMPLE_BIN_RESHAPED_RHS_ONLY [ "${STRATEGY_OPTION}" == "reshaped" ] && run $EXAMPLE_BIN_RESHAPED # Main: Main script }}} -- cgit v1.2.1