15 #ifndef INCLUDED_AILIA
16 #define INCLUDED_AILIA
21 #if defined(_WIN64) || defined(_M_X64) || defined(__amd64__) || defined(__x86_64__) || defined(__APPLE__) || \
22 defined(__ANDROID__) || defined(ANDROID) || defined(__linux__) || defined(NN_NINTENDO_SDK)
25 #define AILIA_API __stdcall
46 #define AILIA_STATUS_SUCCESS (0)
58 #define AILIA_STATUS_INVALID_ARGUMENT (-1)
70 #define AILIA_STATUS_ERROR_FILE_API (-2)
82 #define AILIA_STATUS_INVALID_VERSION (-3)
94 #define AILIA_STATUS_BROKEN (-4)
106 #define AILIA_STATUS_MEMORY_INSUFFICIENT (-5)
118 #define AILIA_STATUS_THREAD_ERROR (-6)
130 #define AILIA_STATUS_INVALID_STATE (-7)
144 #define AILIA_STATUS_UNSUPPORTED_NET (-9)
148 #define AILIA_STATUS_UNSUPPORT_NET (-9)
162 #define AILIA_STATUS_INVALID_LAYER (-10)
174 #define AILIA_STATUS_INVALID_PARAMINFO (-11)
187 #define AILIA_STATUS_NOT_FOUND (-12)
201 #define AILIA_STATUS_GPU_UNSUPPORTED_LAYER (-13)
205 #define AILIA_STATUS_GPU_UNSUPPORT_LAYER (-13)
217 #define AILIA_STATUS_GPU_ERROR (-14)
231 #define AILIA_STATUS_UNIMPLEMENTED (-15)
245 #define AILIA_STATUS_PERMISSION_DENIED (-16)
257 #define AILIA_STATUS_EXPIRED (-17)
271 #define AILIA_STATUS_UNSETTLED_SHAPE (-18)
284 #define AILIA_STATUS_DATA_HIDDEN (-19)
285 #define AILIA_STATUS_DATA_REMOVED AILIA_STATUS_DATA_HIDDEN
298 #define AILIA_STATUS_LICENSE_NOT_FOUND (-20)
312 #define AILIA_STATUS_LICENSE_BROKEN (-21)
327 #define AILIA_STATUS_LICENSE_EXPIRED (-22)
340 #define AILIA_STATUS_NDIMENSION_SHAPE (-23)
354 #define AILIA_STATUS_OTHER_ERROR (-128)
366 #define AILIA_SHAPE_VERSION (1)
415 #define AILIA_MULTITHREAD_AUTO (0)
421 #define AILIA_ENVIRONMENT_ID_AUTO (-1)
428 #define AILIA_DATATYPE_UNDEFINED 0
429 #define AILIA_DATATYPE_FLOAT 1
430 #define AILIA_DATATYPE_UINT8 2
431 #define AILIA_DATATYPE_INT8 3
432 #define AILIA_DATATYPE_UINT16 4
433 #define AILIA_DATATYPE_INT16 5
434 #define AILIA_DATATYPE_INT32 6
435 #define AILIA_DATATYPE_INT64 7
436 #define AILIA_DATATYPE_BOOL 9
437 #define AILIA_DATATYPE_FLOAT16 10
438 #define AILIA_DATATYPE_DOUBLE 11
439 #define AILIA_DATATYPE_UINT32 12
440 #define AILIA_DATATYPE_UINT64 13
441 #define AILIA_DATATYPE_BFLOAT16 16
866 ailiaPredict(
struct AILIANetwork* net,
void* dest,
unsigned int dest_size,
const void* src,
unsigned int src_size);
1330 int AILIA_API ailiaCopyBlobData(
struct AILIANetwork* dst_net,
unsigned int dst_blob_idx,
struct AILIANetwork* src_net,
unsigned int src_blob_idx);
1428 #define AILIA_ENVIRONMENT_VERSION (2)
1430 #define AILIA_ENVIRONMENT_TYPE_CPU (0)
1431 #define AILIA_ENVIRONMENT_TYPE_BLAS (1)
1432 #define AILIA_ENVIRONMENT_TYPE_GPU (2)
1434 #define AILIA_ENVIRONMENT_BACKEND_NONE (0)
1435 #define AILIA_ENVIRONMENT_BACKEND_CUDA (2)
1436 #define AILIA_ENVIRONMENT_BACKEND_MPS (3)
1437 #define AILIA_ENVIRONMENT_BACKEND_VULKAN (6)
1439 #define AILIA_ENVIRONMENT_PROPERTY_NORMAL (0)
1447 #define AILIA_ENVIRONMENT_PROPERTY_LOWPOWER (1)
1455 #define AILIA_ENVIRONMENT_PROPERTY_FP16 (2)
1592 #define AILIA_MEMORY_NO_OPTIMIZATION (0)
1600 #define AILIA_MEMORY_REDUCE_CONSTANT (1)
1608 #define AILIA_MEMORY_REDUCE_CONSTANT_WITH_INPUT_INITIALIZER (2)
1616 #define AILIA_MEMORY_REDUCE_INTERSTAGE (4)
1626 #define AILIA_MEMORY_REUSE_INTERSTAGE (8)
1648 #define AILIA_MEMORY_REDUCE_CONSTANT_WITH_FILE_MAPPED (16)
1650 #define AILIA_MEMORY_OPTIMAIZE_DEFAULT (AILIA_MEMORY_REDUCE_CONSTANT)
1721 #define AILIA_PROFILE_DISABLE (0x00)
1730 #define AILIA_PROFILE_AVERAGE (0x01)
1825 #define ailiaOpenStreamFile ailiaOpenStreamFileW
1826 #define ailiaOpenWeightFile ailiaOpenWeightFileW
1827 #define ailiaSetTemporaryCachePath ailiaSetTemporaryCachePathW
1829 #define ailiaOpenStreamFile ailiaOpenStreamFileA
1830 #define ailiaOpenWeightFile ailiaOpenWeightFileA
1831 #define ailiaSetTemporaryCachePath ailiaSetTemporaryCachePathA
int AILIA_API ailiaOpenWeightMem(struct AILIANetwork *net, const void *buf, unsigned int buf_size)
Reads weights into a network instance. (Read from memory)
#define AILIA_API
Definition: ailia.h:25
int AILIA_API ailiaOpenWeightFileW(struct AILIANetwork *net, const wchar_t *path)
int AILIA_API ailiaOpenWeightFileA(struct AILIANetwork *net, const char *path)
Reads weights into a network instance. (Read from file)
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 ailiaGetSummaryLength(struct AILIANetwork *net, unsigned int *buffer_size)
Gets the size of the buffer needed for the network summary.
int AILIA_API ailiaDisableLayerFusion(struct AILIANetwork *net)
Disalbe layer fusion optimaization for inference.
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).
const char *AILIA_API ailiaGetErrorDetail(struct AILIANetwork *net)
Returns the details of errors.
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 ailiaSetInputBlobShape(struct AILIANetwork *net, const AILIAShape *shape, unsigned int blob_idx, unsigned int version)
Change the shape of the blob given by its index.
int AILIA_API ailiaSetTemporaryCachePathA(const char *cache_dir)
Specifies a temporary cache directory.
int AILIA_API ailiaOpenStreamFileA(struct AILIANetwork *net, const char *path)
Initializes the network instance. (Read from file)
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 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 ailiaGetBlobDataType(struct AILIANetwork *net, int *type, unsigned int blob_idx)
Get the type of Blob.
struct _AILIAEnvironment AILIAEnvironment
const char *AILIA_API ailiaGetVersion(void)
Get the version of the library.
int AILIA_API ailiaGetEnvironmentCount(unsigned int *env_count)
Gets the number of available computational environments (CPU, GPU).
int AILIA_API ailiaGetOutputBlobCount(struct AILIANetwork *net, unsigned int *output_blob_count)
Get the number of output data blobs.
void AILIA_API ailiaDestroy(struct AILIANetwork *net)
It destroys the network instance.
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 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 ailiaOpenStreamFileW(struct AILIANetwork *net, const wchar_t *path)
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.
int AILIA_API ailiaFinalize(void)
Release GPU and other resources that have been globally allocated with ailia.
int AILIA_API ailiaSetTemporaryCachePathW(const wchar_t *cache_dir)
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 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 ailiaSetMemoryMode(struct AILIANetwork *net, unsigned int mode)
Set the memory usage policy for inference.
int AILIA_API ailiaGetEnvironment(AILIAEnvironment **env, unsigned int env_idx, unsigned int version)
Gets the list of computational environments.
int AILIA_API ailiaGetInputBlobCount(struct AILIANetwork *net, unsigned int *input_blob_count)
Get the number of input data blobs.
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 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.
int AILIA_API ailiaGetOutputDim(struct AILIANetwork *net, unsigned int *dim)
Gets the dimension of the output data during inference.
struct _AILIAShape AILIAShape
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 ailiaGetInputShape(struct AILIANetwork *net, AILIAShape *shape, unsigned int version)
Gets the shape of the input data during inference.
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 AILIA_API ailiaUpdate(struct AILIANetwork *net)
Makes inferences with the input data specified in advance.
int AILIA_API ailiaCreate(struct AILIANetwork **net, int env_id, int num_thread)
Creates a network instance.
int AILIA_API ailiaGetInputDim(struct AILIANetwork *net, unsigned int *dim)
Gets the dimension of the input data during inference.
int AILIA_API ailiaGetOutputShapeND(struct AILIANetwork *net, unsigned int *shape, unsigned int dim)
Gets the shape of the output data during inference.
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 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 ailiaOpenStreamMem(struct AILIANetwork *net, const void *buf, unsigned int buf_size)
Initializes the network instance. (Read from memory)
int AILIA_API ailiaSetProfileMode(struct AILIANetwork *net, unsigned int mode)
Set the profile mode.
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 ailiaGetBlobCount(struct AILIANetwork *net, unsigned int *blob_count)
Gets the amount of internal data (blob) during inference.
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 ailiaGetBlobIndexByOutputIndex(struct AILIANetwork *net, unsigned int *blob_idx, unsigned int output_blob_idx)
Get the blob index of the input data blob.
int AILIA_API ailiaGetSelectedEnvironment(struct AILIANetwork *net, AILIAEnvironment **env, unsigned int version)
Gets the selected computational environment.
int AILIA_API ailiaSetInputShapeND(struct AILIANetwork *net, const unsigned int *shape, unsigned int dim)
Changes the shape of the input data during inference.
const char * name
Definition: ailia.h:1481
int backend
Definition: ailia.h:1489
int type
Definition: ailia.h:1473
int id
Definition: ailia.h:1465
int props
Definition: ailia.h:1497
unsigned int w
Definition: ailia.h:400
unsigned int z
Definition: ailia.h:392
unsigned int y
Definition: ailia.h:384
unsigned int x
Definition: ailia.h:376
unsigned int dim
Definition: ailia.h:408
Definition: ailia_call.h:202