How to pass "-cl-std=CL2" option to malioc?

I wan to build OpenCL 2.0 kernel (it uses OpenCL C 2.0 language in kernel code) using malioc (Mali Offline Compiler) .

Here is my command line:

malioc --name TestKernel --core Mali-G76

In my kernel code I check value of __OPENCL_VERSION__ and it equals 200, however  __OPENCL_C_VERSION__ equals 120 and, of course, OpenCL2.0 buildin methods (like work_group_reduce_add) are not available.

So, my question is:
How to pass "-cl-std=CL2"  OpenCL build option to malioc?

  • here is full output of malioc --help (and I don't see any way to pass OpenCL build options here):

    Mali Offline Compiler v7.0.0 (Build c38421)
    Copyright 2007-2019 Arm Limited, all rights reserved


    malioc [--fragment|--vertex|--compute|--geometry|--tessellation_control
    |--tessellation_evaluation|--kernel|--list|--info] [--essl
    |--spirv] [-c <core>] [-y <NAME>] [-n <NAME>] [-D
    <NAME[=VALUE]>] ... [--] [--version] [-h] <input files> ...


    No shader type flag
    Infer the shader type from the file extensions of the passed in source
    files, where:
    .vert - OpenGL ES Vertex Shader
    .frag - OpenGL ES Fragment Shader
    .comp - OpenGL ES Compute Shader
    .geom - OpenGL ES Geometry Shader
    .tesc - OpenGL ES Tessellation Control Shader
    .tese - OpenGL ES Tessellation Evaluation Shader
    .cl - OpenCL Kernel
    If there is more than one input file and they have more than one of
    the above file extensions, the source type must be explicitly
    specified. The shader type must be explicitly specified for SPIR-V
    binary files.
    -f, --fragment
    Explicitly specify shader type as fragment.
    -- OR --
    -v, --vertex
    Explicitly specify shader type as vertex.
    -C, --compute
    Explicitly specify shader type as compute.
    -- OR --
    -g, --geometry
    Explicitly specify shader type as geometry.
    -- OR --
    -t, --tessellation_control
    Explicitly specify shader type as tessellation control.
    -- OR --
    -e, --tessellation_evaluation
    Explicitly specify shader type as tessellation evaluation.
    -- OR --
    -k, --kernel
    Explicitly specify shader type as OpenCL kernel.
    -- OR --
    -l, --list
    List the valid combinations of available drivers and cores with their
    latest revision.
    -- OR --
    -i, --info
    Print information about a specific driver and core with latest
    -- OR --

    -s, --essl
    Specify the input file(s) format as ESSL source code.
    -- OR --
    -p, --spirv
    Specify the input file format as SPIR-V.

    -c <core>, --core <core>
    Target specific hardware core.

    -y <NAME>, --spirv_entrypoint_name <NAME>
    Specify a SPIR-V entrypoint name.

    -n <NAME>, --name <NAME>
    Specify a kernel name.

    -D <NAME[=VALUE]>, --define <NAME[=VALUE]> (accepted multiple times)
    Define NAME as a preprocessor macro, with definition VALUE.

    --, --ignore_rest
    Ignores the rest of the labeled arguments following this flag.

    Displays version information and exits.

    -h, --help
    Displays usage information and exits.

    <input files> (accepted multiple times)
    Input files to compile. If the input files are ESSL source files, the
    contents is concatenated together in the order they were specified. In
    case the input file is a SPIR-V binary, one file can be specified at

  • This is a known issue in the current offline compiler; only CL 1.x kernels are supported. This should get fixed later in the year, but it won't be in the 2020.0 Mobile Studio release.


More questions in this forum