Blink API
Loading...
Searching...
No Matches
BlinkC.h
Go to the documentation of this file.
1// Copyright (c) 2013 The Foundry Visionmongers Ltd. All Rights Reserved.
2
7#ifndef Blink_Library_BlinkC_h
8#define Blink_Library_BlinkC_h
9#include "BlinkBuild.h"
10#include "BlinkTypes.h"
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#define BLINK_SUCCESS 0
16#define BLINK_ERROR_ERROR 1
17#define BLINK_ERROR_OUT_OF_MEMORY 2
18#define BLINK_ERROR_RUNNING_KERNEL 3
19#define BLINK_ERROR_PARSING_KERNEL 4
20#define BLINK_ERROR_COMPILING_KERNEL 5
21#define BLINK_ERROR_INVALID_IMAGE_SPEC 6
22#define BLINK_ERROR_DEVICE 7
23#define BLINK_ERROR_PARAMETER 8
24#define BLINK_ERROR_INCOMPATIBLE_IMAGES 9
25#define BLINK_ERROR_INVALID_PROPERTY 10
26
27#define BLINK_PROPERTY_NAME 0
28
29
30BLINK_SHARED_API BlinkRef Blink_Retain(BlinkRef ref);
31BLINK_SHARED_API void Blink_Release(BlinkRef ref);
32
33BLINK_SHARED_API const char* Blink_Error_GetUserMessage(BlinkErrorRef errorRef);
34BLINK_SHARED_API BlinkErrorCode Blink_Error_GetStringProperty(BlinkErrorRef errorRef, BlinkErrorProperty property, const char** string);
35BLINK_SHARED_API BlinkErrorCode Blink_Error_GetIntProperty(BlinkErrorRef errorRef, BlinkErrorProperty property, int* value);
36
37BLINK_SHARED_API BlinkErrorCode Blink_Device_CurrentCPUDevice(BlinkRef* pRef, BlinkErrorRef* optionalErrorDesc);
38BLINK_SHARED_API BlinkErrorCode Blink_Device_CurrentGPUDevice(BlinkRef* pRef, BlinkErrorRef* optionalErrorDesc);
39BLINK_SHARED_API BlinkErrorCode Blink_Device_DeviceWithID(BlinkRef* pRef, BlinkComputeDeviceID id, BlinkErrorRef* optionalErrorDesc);
40
41BLINK_SHARED_API BlinkErrorCode Blink_Device_Available(BlinkRef device, char* value, BlinkErrorRef* optionalErrorDesc);
42
43BLINK_SHARED_API BlinkErrorCode Blink_Device_Bind(BlinkRef* pRef, BlinkRef device, BlinkErrorRef* optionalErrorDesc);
44
45BLINK_SHARED_API BlinkErrorCode Blink_Device_GetProperty(BlinkRef device, BlinkPropertyType type, void* data, int* size, BlinkErrorRef* optionalErrorDesc);
46
47BLINK_SHARED_API BlinkErrorCode Blink_Image_CreateEmptyImage(BlinkRef* pRef, BlinkErrorRef* optionalErrorDesc);
48BLINK_SHARED_API BlinkErrorCode Blink_Image_CreateImage(BlinkRef* pRef, const struct BlinkImageInfo* imageInfo, BlinkRef device, BlinkErrorRef* optionalErrorDesc);
49BLINK_SHARED_API BlinkErrorCode Blink_Image_ImageForDeviceMemory(BlinkRef* pRef, const struct BlinkDeviceMemory* deviceMemory, const struct BlinkImageInfo* imageInfo, const struct BlinkBufferDesc* layout, BlinkRef device, BlinkErrorRef* optionalErrorDesc);
50
51BLINK_SHARED_API BlinkErrorCode Blink_Image_CopyRef(BlinkRef* pRef, BlinkRef src, BlinkErrorRef* optionalErrorDesc);
52BLINK_SHARED_API BlinkErrorCode Blink_Image_DistributeTo(BlinkRef* pRef, BlinkRef src, BlinkRef device, BlinkErrorRef* optionalErrorDesc);
53BLINK_SHARED_API BlinkErrorCode Blink_Image_MakeLike(BlinkRef* pRef, BlinkRef src, BlinkRef device, BlinkErrorRef* optionalErrorDesc);
54BLINK_SHARED_API BlinkErrorCode Blink_Image_Info(BlinkRef image, struct BlinkImageInfo* info, BlinkErrorRef* optionalErrorDesc);
55BLINK_SHARED_API BlinkErrorCode Blink_Image_Clear(BlinkRef image, BlinkErrorRef* optionalErrorDesc);
56BLINK_SHARED_API BlinkErrorCode Blink_Image_IsEmpty(BlinkRef image, char* result, BlinkErrorRef* optionalErrorDesc);
57BLINK_SHARED_API BlinkErrorCode Blink_Image_CopyFrom(BlinkRef dst, BlinkRef src, BlinkErrorRef* optionalErrorDesc);
58
59BLINK_SHARED_API BlinkErrorCode Blink_Image_CopyFromBuffer(BlinkRef dst, const void* src, const struct BlinkBufferDesc* bufferDesc, BlinkErrorRef* optionalErrorDesc);
60BLINK_SHARED_API BlinkErrorCode Blink_Image_CopyToBuffer(BlinkRef src, void* dst, const struct BlinkBufferDesc* bufferDesc, BlinkErrorRef* optionalErrorDesc);
61
62
63BLINK_SHARED_API BlinkErrorCode Blink_IKernel_Make(BlinkRef* pRef, BlinkRef programSource, BlinkErrorRef* optionalErrorDesc);
64BLINK_SHARED_API BlinkErrorCode Blink_IKernel_GetKernelInfo(BlinkRef ref, struct BlinkKernelInfo* kInfo, BlinkErrorRef* optionalErrorDesc);
65BLINK_SHARED_API BlinkErrorCode Blink_IKernel_GetNumImages(BlinkRef ref, unsigned* nImgs, BlinkErrorRef* optionalErrorDesc);
66BLINK_SHARED_API BlinkErrorCode Blink_IKernel_GetNumParameters(BlinkRef ref, unsigned* nParams, BlinkErrorRef* optionalErrorDesc);
67BLINK_SHARED_API BlinkErrorCode Blink_IKernel_GetImageInfo(BlinkRef ref, unsigned index, struct BlinkKernelImageInfo* imgInfo, BlinkErrorRef* optionalErrorDesc);
68BLINK_SHARED_API BlinkErrorCode Blink_IKernel_GetParameterInfo(BlinkRef ref, unsigned index, struct BlinkKernelParameterInfo* paramInfo, BlinkErrorRef* optionalErrorDesc);
69
70BLINK_SHARED_API BlinkErrorCode Blink_Kernel_Make(BlinkRef* pRef, BlinkRef programSource, BlinkRef dev, BlinkRef* images, int nImages, BlinkCodegenFlags flags, BlinkErrorRef* optionalErrorDesc);
71
72BLINK_SHARED_API BlinkErrorCode Blink_Kernel_SetIntParam(BlinkRef ref, const char* name, const int* values, int nValues, BlinkErrorRef* optionalErrorDesc);
73BLINK_SHARED_API BlinkErrorCode Blink_Kernel_SetFloatParam(BlinkRef ref, const char* name, const float* values, int nValues, BlinkErrorRef* optionalErrorDesc);
74BLINK_SHARED_API BlinkErrorCode Blink_Kernel_SetBoolParam(BlinkRef ref, const char* name, const char* values, int nValues, BlinkErrorRef* optionalErrorDesc);
75
76BLINK_SHARED_API BlinkErrorCode Blink_Kernel_GetIntParam(BlinkRef ref, const char* name, int* values, int nValues, BlinkErrorRef* optionalErrorDesc);
77BLINK_SHARED_API BlinkErrorCode Blink_Kernel_GetFloatParam(BlinkRef ref, const char* name, float* values, int nValues, BlinkErrorRef* optionalErrorDesc);
78BLINK_SHARED_API BlinkErrorCode Blink_Kernel_GetBoolParam(BlinkRef ref, const char* name, char* values, int nValues, BlinkErrorRef* optionalErrorDesc);
79
80BLINK_SHARED_API BlinkErrorCode Blink_Kernel_GetNumInputRanges(BlinkRef ref, unsigned int* count, BlinkErrorRef* optionalErrorDesc);
81BLINK_SHARED_API BlinkErrorCode Blink_Kernel_GetInputRanges(BlinkRef ref, struct BlinkImageAccessDesc* accessDescs, unsigned int maxDescs, BlinkErrorRef* optionalErrorDesc);
82
83BLINK_SHARED_API BlinkErrorCode Blink_Kernel_Iterate(BlinkRef ref, BlinkErrorRef* optionalErrorDesc);
84BLINK_SHARED_API BlinkErrorCode Blink_Kernel_IterateWithController(BlinkRef ref, const struct BlinkKernelIterationController* controller, BlinkErrorRef* optionalErrorDesc);
85
86BLINK_SHARED_API BlinkErrorCode Blink_ProgramSource_Make(BlinkRef* pRef, const char* source, BlinkErrorRef* optionalErrorDesc);
87
88
89//This function may change before release.
90BLINK_SHARED_API BlinkErrorCode Blink_Add_Precompiled_Kernel(const char* key,
91 const void* targetCodeData,
92 int targetCodeCompressedSize,
93 int targetCodeUncompressedSize,
94 const void* sharedLibData,
95 int sharedLibCompressedSize,
96 int sharedLibUncompressedSize,
97 const void* execInfoData,
98 int execInfoSize);
99
100
101#ifdef __cplusplus
102}
103#endif
104#endif
Definitions required for building with the Blink API.
Defines some types used by the Blink API.
Definition: BlinkTypes.h:89
Definition: BlinkTypes.h:96
Definition: BlinkTypes.h:151
Image description.
Definition: BlinkTypes.h:70
Definition: BlinkTypes.h:125
General information about a kernel.
Definition: BlinkTypes.h:111
Image iteration description.
Definition: BlinkTypes.h:80
Definition: BlinkTypes.h:140


©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com