15 #ifndef INCLUDED_AILIA 16 #define INCLUDED_AILIA 21 #include <emscripten.h> 22 #define AILIA_API EMSCRIPTEN_KEEPALIVE 23 #elif defined(_WIN64) || defined(_M_X64) || defined(__amd64__) || defined(__x86_64__) || defined(__APPLE__) || \ 24 defined(__ANDROID__) || defined(ANDROID) || defined(__linux__) || defined(NN_NINTENDO_SDK) 27 #define AILIA_API __stdcall 48 #define AILIA_STATUS_SUCCESS (0) 60 #define AILIA_STATUS_INVALID_ARGUMENT (-1) 72 #define AILIA_STATUS_ERROR_FILE_API (-2) 84 #define AILIA_STATUS_INVALID_VERSION (-3) 96 #define AILIA_STATUS_BROKEN (-4) 108 #define AILIA_STATUS_MEMORY_INSUFFICIENT (-5) 120 #define AILIA_STATUS_THREAD_ERROR (-6) 132 #define AILIA_STATUS_INVALID_STATE (-7) 146 #define AILIA_STATUS_UNSUPPORT_NET (-9) 160 #define AILIA_STATUS_INVALID_LAYER (-10) 172 #define AILIA_STATUS_INVALID_PARAMINFO (-11) 185 #define AILIA_STATUS_NOT_FOUND (-12) 199 #define AILIA_STATUS_GPU_UNSUPPORT_LAYER (-13) 211 #define AILIA_STATUS_GPU_ERROR (-14) 225 #define AILIA_STATUS_UNIMPLEMENTED (-15) 239 #define AILIA_STATUS_PERMISSION_DENIED (-16) 251 #define AILIA_STATUS_EXPIRED (-17) 265 #define AILIA_STATUS_UNSETTLED_SHAPE (-18) 278 #define AILIA_STATUS_DATA_HIDDEN (-19) 279 #define AILIA_STATUS_DATA_REMOVED AILIA_STATUS_DATA_HIDDEN 292 #define AILIA_STATUS_LICENSE_NOT_FOUND (-20) 306 #define AILIA_STATUS_LICENSE_BROKEN (-21) 321 #define AILIA_STATUS_LICENSE_EXPIRED (-22) 334 #define AILIA_STATUS_NDIMENSION_SHAPE (-23) 348 #define AILIA_STATUS_OTHER_ERROR (-128) 360 #define AILIA_SHAPE_VERSION (1) 409 #define AILIA_MULTITHREAD_AUTO (0) 415 #define AILIA_ENVIRONMENT_ID_AUTO (-1) 421 #define AILIA_DATATYPE_UNDEFINED 0 422 #define AILIA_DATATYPE_FLOAT 1 423 #define AILIA_DATATYPE_UINT8 2 424 #define AILIA_DATATYPE_INT8 3 425 #define AILIA_DATATYPE_UINT16 4 426 #define AILIA_DATATYPE_INT16 5 427 #define AILIA_DATATYPE_INT32 6 428 #define AILIA_DATATYPE_INT64 7 429 #define AILIA_DATATYPE_BOOL 9 430 #define AILIA_DATATYPE_FLOAT16 10 431 #define AILIA_DATATYPE_DOUBLE 11 432 #define AILIA_DATATYPE_UINT32 12 433 #define AILIA_DATATYPE_UINT64 13 434 #define AILIA_DATATYPE_BFLOAT16 16 859 ailiaPredict(
struct AILIANetwork* net,
void* dest,
unsigned int dest_size,
const void* src,
unsigned int src_size);
1141 int AILIA_API ailiaSummary(
struct AILIANetwork* net,
char*
const buffer,
const unsigned int buffer_size);
1323 int AILIA_API ailiaCopyBlobData(
struct AILIANetwork* dst_net,
unsigned int dst_blob_idx,
struct AILIANetwork* src_net,
unsigned int src_blob_idx);
1421 #define AILIA_ENVIRONMENT_VERSION (2) 1423 #define AILIA_ENVIRONMENT_TYPE_CPU (0) 1424 #define AILIA_ENVIRONMENT_TYPE_BLAS (1) 1425 #define AILIA_ENVIRONMENT_TYPE_GPU (2) 1426 #define AILIA_ENVIRONMENT_TYPE_REMOTE (3) 1428 #define AILIA_ENVIRONMENT_BACKEND_NONE (0) 1429 #define AILIA_ENVIRONMENT_BACKEND_CUDA (2) 1430 #define AILIA_ENVIRONMENT_BACKEND_MPS (3) 1431 #define AILIA_ENVIRONMENT_BACKEND_VULKAN (6) 1433 #define AILIA_ENVIRONMENT_PROPERTY_NORMAL (0) 1441 #define AILIA_ENVIRONMENT_PROPERTY_LOWPOWER (1) 1449 #define AILIA_ENVIRONMENT_PROPERTY_FP16 (2) 1588 #define AILIA_MEMORY_NO_OPTIMIZATION (0) 1596 #define AILIA_MEMORY_REDUCE_CONSTANT (1) 1604 #define AILIA_MEMORY_REDUCE_CONSTANT_WITH_INPUT_INITIALIZER (2) 1612 #define AILIA_MEMORY_REDUCE_INTERSTAGE (4) 1622 #define AILIA_MEMORY_REUSE_INTERSTAGE (8) 1644 #define AILIA_MEMORY_REDUCE_CONSTANT_WITH_FILE_MAPPED (16) 1646 #define AILIA_MEMORY_OPTIMAIZE_DEFAULT (AILIA_MEMORY_REDUCE_CONSTANT) 1717 #define AILIA_PROFILE_DISABLE (0x00) 1726 #define AILIA_PROFILE_AVERAGE (0x01) 1821 #define ailiaOpenStreamFile ailiaOpenStreamFileW 1822 #define ailiaOpenWeightFile ailiaOpenWeightFileW 1823 #define ailiaSetTemporaryCachePath ailiaSetTemporaryCachePathW 1825 #define ailiaOpenStreamFile ailiaOpenStreamFileA 1826 #define ailiaOpenWeightFile ailiaOpenWeightFileA 1827 #define ailiaSetTemporaryCachePath ailiaSetTemporaryCachePathA int AILIA_API ailiaGetBlobDim(struct AILIANetwork *net, unsigned int *dim, unsigned int blob_idx)
Gets the dimension of the internal data (blob) during inference.
int type
Definition: ailia.h:1467
int AILIA_API ailiaGetBlobData(struct AILIANetwork *net, void *dest, unsigned int dest_size, unsigned int blob_idx)
Gets the internal data (blob) during inference.
int AILIA_API ailiaGetBlobShape(struct AILIANetwork *net, AILIAShape *shape, unsigned int blob_idx, unsigned int version)
Gets the shape of the internal data (blob) during inference.
int AILIA_API ailiaGetOutputShapeND(struct AILIANetwork *net, unsigned int *shape, unsigned int dim)
Gets the shape of the output data during inference.
const char *AILIA_API ailiaGetStatusString(int status_code)
Returns the string describing given status code.
int AILIA_API ailiaGetOutputShape(struct AILIANetwork *net, AILIAShape *shape, unsigned int version)
Gets the shape of the output data during inference.
int AILIA_API ailiaSetInputBlobShape(struct AILIANetwork *net, const AILIAShape *shape, unsigned int blob_idx, unsigned int version)
Change the shape of the blob given by its index.
const char *AILIA_API ailiaGetErrorDetail(struct AILIANetwork *net)
Returns the details of errors.
int AILIA_API ailiaGetOutputBlobCount(struct AILIANetwork *net, unsigned int *output_blob_count)
Get the number of output data blobs.
int AILIA_API ailiaUpdate(struct AILIANetwork *net)
Makes inferences with the input data specified in advance.
void AILIA_API ailiaDestroy(struct AILIANetwork *net)
It destroys the network instance.
int AILIA_API ailiaSetMemoryMode(struct AILIANetwork *net, unsigned int mode)
Set the memory usage policy for inference.
int AILIA_API ailiaOpenWeightFileW(struct AILIANetwork *net, const wchar_t *path)
int AILIA_API ailiaOpenWeightMem(struct AILIANetwork *net, const void *buf, unsigned int buf_size)
Reads weights into a network instance. (Read from memory)
int AILIA_API ailiaGetBlobNameLengthByIndex(struct AILIANetwork *net, const unsigned int blob_idx, unsigned int *buffer_size)
Gets the size of the buffer needed for output of the name of the internal data (blob).
unsigned int z
Definition: ailia.h:386
struct _AILIAShape AILIAShape
int AILIA_API ailiaFindBlobIndexByName(struct AILIANetwork *net, unsigned int *blob_idx, const char *name)
Searches by name for the index of the internal data (blob) during inference and returns it...
int AILIA_API ailiaFindBlobNameByIndex(struct AILIANetwork *net, char *buffer, const unsigned int buffer_size, const unsigned int blob_idx)
Searches by index for the name of the internal data (blob) during inference and returns it...
int props
Definition: ailia.h:1491
int AILIA_API ailiaCreate(struct AILIANetwork **net, int env_id, int num_thread)
Creates a network instance.
int AILIA_API ailiaGetInputShapeND(struct AILIANetwork *net, unsigned int *shape, unsigned int dim)
Gets the shape of the input data during inference.
int AILIA_API ailiaGetSummaryLength(struct AILIANetwork *net, unsigned int *buffer_size)
Gets the size of the buffer needed for the network summary.
int AILIA_API ailiaGetBlobDataType(struct AILIANetwork *net, int *type, unsigned int blob_idx)
Get the type of Blob.
int AILIA_API ailiaGetBlobIndexByInputIndex(struct AILIANetwork *net, unsigned int *blob_idx, unsigned int input_blob_idx)
Get the blob index of the input data.
int AILIA_API ailiaFinalize(void)
Release GPU and other resources that have been globally allocated with ailia.
unsigned int w
Definition: ailia.h:394
unsigned int x
Definition: ailia.h:370
int AILIA_API ailiaGetInputShape(struct AILIANetwork *net, AILIAShape *shape, unsigned int version)
Gets the shape of the input data during inference.
int AILIA_API ailiaDisableLayerFusion(struct AILIANetwork *net)
Disalbe layer fusion optimaization for inference.
int AILIA_API ailiaOpenStreamFileA(struct AILIANetwork *net, const char *path)
Initializes the network instance. (Read from file)
int AILIA_API ailiaGetInputDim(struct AILIANetwork *net, unsigned int *dim)
Gets the dimension of the input data during inference.
unsigned int y
Definition: ailia.h:378
int AILIA_API ailiaGetOutputDim(struct AILIANetwork *net, unsigned int *dim)
Gets the dimension of the output data during inference.
int AILIA_API ailiaOpenWeightEx(struct AILIANetwork *net, const void *fopen_args, ailiaFileCallback callback, int version)
Reads weights into a network instance. (User-defined file access callback)
int AILIA_API ailiaGetEnvironmentCount(unsigned int *env_count)
Gets the number of available computational environments (CPU, GPU).
int AILIA_API ailiaOpenStreamMem(struct AILIANetwork *net, const void *buf, unsigned int buf_size)
Initializes the network instance. (Read from memory)
int AILIA_API ailiaPredict(struct AILIANetwork *net, void *dest, unsigned int dest_size, const void *src, unsigned int src_size)
Performs the inferences and provides the inference result.
#define AILIA_API
Definition: ailia.h:27
int AILIA_API ailiaSetTemporaryCachePathA(const char *cache_dir)
Specifies a temporary cache directory.
int AILIA_API ailiaSetInputShape(struct AILIANetwork *net, const AILIAShape *shape, unsigned int version)
Changes the shape of the input data during inference.
int AILIA_API ailiaOpenWeightFileA(struct AILIANetwork *net, const char *path)
Reads weights into a network instance. (Read from file)
int AILIA_API ailiaGetInputBlobCount(struct AILIANetwork *net, unsigned int *input_blob_count)
Get the number of input data blobs.
int backend
Definition: ailia.h:1483
int AILIA_API ailiaCopyBlobData(struct AILIANetwork *dst_net, unsigned int dst_blob_idx, struct AILIANetwork *src_net, unsigned int src_blob_idx)
Perform copies between blobs that specified.
int AILIA_API ailiaGetSelectedEnvironment(struct AILIANetwork *net, AILIAEnvironment **env, unsigned int version)
Gets the selected computational environment.
struct _AILIAEnvironment AILIAEnvironment
int AILIA_API ailiaOpenStreamEx(struct AILIANetwork *net, const void *fopen_args, ailiaFileCallback callback, int version)
Initializes the network instance. (User-defined file access callback)
int id
Definition: ailia.h:1459
int AILIA_API ailiaGetBlobCount(struct AILIANetwork *net, unsigned int *blob_count)
Gets the amount of internal data (blob) during inference.
int AILIA_API ailiaSetInputBlobShapeND(struct AILIANetwork *net, const unsigned *shape, const unsigned dim, unsigned int blob_idx)
Change the shape of the blob given by its index.
Definition: ailia_call.h:206
int AILIA_API ailiaOpenStreamFileW(struct AILIANetwork *net, const wchar_t *path)
const char * name
Definition: ailia.h:1475
unsigned int dim
Definition: ailia.h:402
int AILIA_API ailiaSummary(struct AILIANetwork *net, char *const buffer, const unsigned int buffer_size)
Shows the name and shape of each blob.
int AILIA_API ailiaSetInputBlobData(struct AILIANetwork *net, const void *src, unsigned int src_size, unsigned int blob_idx)
Provides the specified blob with the input data.
int AILIA_API ailiaSetTemporaryCachePathW(const wchar_t *cache_dir)
int AILIA_API ailiaGetBlobIndexByOutputIndex(struct AILIANetwork *net, unsigned int *blob_idx, unsigned int output_blob_idx)
Get the blob index of the input data blob.
const char *AILIA_API ailiaGetVersion(void)
Get the version of the library.
int AILIA_API ailiaGetBlobShapeND(struct AILIANetwork *net, unsigned int *shape, unsigned int dim, unsigned int blob_idx)
Gets the amount of internal data (blob) during inference.
int AILIA_API ailiaGetEnvironment(AILIAEnvironment **env, unsigned int env_idx, unsigned int version)
Gets the list of computational environments.
int AILIA_API ailiaSetProfileMode(struct AILIANetwork *net, unsigned int mode)
Set the profile mode.
int AILIA_API ailiaSetInputShapeND(struct AILIANetwork *net, const unsigned int *shape, unsigned int dim)
Changes the shape of the input data during inference.