Main Content

coder.BLASCallback.getBLASIntTypeName

Class: coder.BLASCallback
Package: coder

Return name of integer data type used by CBLAS interface

Syntax

intTypeName = coder.BLASCallback.getBLASIntTypeName()

Description

intTypeName = coder.BLASCallback.getBLASIntTypeName() returns the name of the integer data type that is used by the CBLAS interface to a specific BLAS library.

coder.BLASCallback is an abstract class for defining a BLAS callback class. A BLAS callback class specifies the BLAS library and CBLAS header and data type information to use for BLAS calls in code generated from MATLAB® code. At code generation time, if you specify a BLAS callback class, for certain vector and matrix function calls, the code generator produces BLAS calls in standalone code.

getBLASIntTypeName is an abstract method. You must implement it in the definition of your callback class that derives from coder.BLASCallback.The generated code uses the integer data type name to specify types of variables in the generated code that produces BLAS calls.

Output Arguments

expand all

Character vector that specifies the name of the integer data type that the CBLAS interface to a specific BLAS library uses.

Attributes

Abstracttrue
Statictrue

To learn about attributes of methods, see Method Attributes.

Examples

expand all

This example shows how to write a getBLASIntTypeName method to return the name of the CBLAS integer data type.

In a class that derives from coder.BLASCallback, write a method getBLASIntTypeName that returns the name of the CBLAS integer data type as a character vector. This example is an implementation of the callback class mklcallback for integration with the Intel MKL BLAS library on a Windows® platform. In this class, getBLASIntTypeName returns 'MKL_INT', which is the CBLAS integer data type for the Intel MKL BLAS library.

classdef mklcallback < coder.BLASCallback
    methods (Static)
        function updateBuildInfo(buildInfo, ~)
            libPath = fullfile(pwd,'mkl','WIN','lib','intel64');
            libPriority = '';
            libPreCompiled = true;
            libLinkOnly = true;
            libs = {'mkl_intel_ilp64.lib' 'mkl_intel_thread.lib' 'mkl_core.lib'};
            buildInfo.addLinkObjects(libs, libPath, libPriority, libPreCompiled, libLinkOnly);
            buildInfo.addLinkObjects('libiomp5md.lib',fullfile(matlabroot,'bin','win64'), ...
                libPriority, libPreCompiled, libLinkOnly);
            buildInfo.addIncludePaths(fullfile(pwd,'mkl','WIN','include'));
            buildInfo.addDefines('-DMKL_ILP64');
        end
        function headerName = getHeaderFilename()
            headerName = 'mkl_cblas.h';
        end
        function intTypeName = getBLASIntTypeName()
            intTypeName = 'MKL_INT';
        end
    end
end

If you are using a different BLAS library, replace 'MKL_INT' with the name of your CBLAS integer data type.

Introduced in R2018b