Documentation

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.BLASCallbackis 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.

getBLASIntTypeNameis an abstract method. You must implement it in the definition of your callback class that derives fromcoder.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

Abstract true
Static true

To learn about attributes of methods, seeMethod Attributes(MATLAB).

Examples

expand all

This example shows how to write agetBLASIntTypeNamemethod to return the name of the CBLAS integer data type.

In a class that derives fromcoder.BLASCallback, write a methodgetBLASIntTypeNamethat returns the name of the CBLAS integer data type as a character vector. This example is an implementation of the callback classmklcallbackfor integration with theIntel MKLBLAS library on a Windows®platform. In this class,getBLASIntTypeNamereturns'MKL_INT', which is the CBLAS integer data type for theIntel MKLBLAS library.

classdefmklcallback < coder.BLASCallbackmethods(Static)functionupdateBuildInfo(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');endfunctionheaderName = getHeaderFilename() headerName ='mkl_cblas.h';endfunctionintTypeName = getBLASIntTypeName() intTypeName ='MKL_INT';endendend

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

Introduced in R2018b