![]() | ![]() | ![]() | Liboil Reference Manual | ![]() |
---|
OilFunctionOilFunction — |
#define LIBOIL_CHECK_PROTOTYPE (a) #define OIL_OPT_MANGLE (a) #define OIL_OPT_FLAG_MANGLE (a) #define OIL_NO_CLASSES #define OIL_OPT_SUFFIX OilFunctionImpl; #define OIL_GET (ptr, offset, type) #define OIL_OFFSET (ptr, offset) #define OIL_INCREMENT (ptr, offset) #define OIL_IMPL_FLAG_REF #define OIL_IMPL_FLAG_OPT #define OIL_IMPL_FLAG_ASM #define OIL_IMPL_FLAG_DISABLED #define OIL_CPU_FLAG_MASK #define OIL_IMPL_FLAG_CMOV #define OIL_IMPL_FLAG_MMX #define OIL_IMPL_FLAG_SSE #define OIL_IMPL_FLAG_MMXEXT #define OIL_IMPL_FLAG_SSE2 #define OIL_IMPL_FLAG_3DNOW #define OIL_IMPL_FLAG_3DNOWEXT #define OIL_IMPL_FLAG_ALTIVEC #define OIL_DECLARE_CLASS (klass) #define OIL_DEFINE_CLASS_FULL (klass, string, test) #define OIL_DEFINE_CLASS (klass, string) #define OIL_DEFINE_IMPL_FULL (function,klass,flags) #define OIL_DEFINE_IMPL (function,klass) #define OIL_DEFINE_IMPL_REF (function,klass) #define OIL_DEFINE_IMPL_ASM (function,klass) #define OIL_DEFINE_IMPL_DEPENDS (function,klass,...) void oil_optimize_all (void); void oil_optimize (const char *class_name); OilFunctionClass* oil_class_get_by_index (int i); OilFunctionClass* oil_class_get (const char *class_name); void oil_class_optimize (OilFunctionClass *klass); int oil_class_get_n_classes (void); OilFunctionImpl* oil_impl_get_by_index (int i); int oil_impl_is_runnable (OilFunctionImpl *impl); void oil_class_choose_by_name (OilFunctionClass *klass, const char *name); void oil_class_register_impl_by_name (const char *klass_name, OilFunctionImpl *impl);
typedef struct { void *next; OilFunctionClass *klass; void *func; unsigned int flags; const char *name; double profile_ave; double profile_std; } OilFunctionImpl;
#define OIL_GET(ptr, offset, type) (*(type *)((uint8_t *)ptr + offset) )
ptr : | |
offset : | |
type : |
#define OIL_INCREMENT(ptr, offset) (ptr = (void *)((uint8_t *)ptr + offset) )
ptr : | |
offset : |
#define OIL_DEFINE_IMPL_DEPENDS(function,klass,...)
function : | |
klass : | |
... : |
void oil_optimize (const char *class_name);
Optimizes function class given by class_name.
class_name : | name of function class to optimize |
OilFunctionClass* oil_class_get_by_index (int i);
Returns a pointer to the function class with index i.
i : | index of function class |
Returns : | a pointer to a function class structure |
OilFunctionClass* oil_class_get (const char *class_name);
Returns a pointer to the function class that has the given class name. If no such class is found, NULL is returned.
class_name : | the name of the function class |
Returns : | a pointer to a function class |
void oil_class_optimize (OilFunctionClass *klass);
Tests and profiles each implementation for the given function class. Testing compares the output of running each implementation on random input against the reference implementation for the same input.
klass : | a function class |
int oil_class_get_n_classes (void);
Returns : | the number of function classes |
OilFunctionImpl* oil_impl_get_by_index (int i);
Returns a pointer to the function implementation with index i.
i : | index |
Returns : | a pointer to a function implementation structure |
int oil_impl_is_runnable (OilFunctionImpl *impl);
Determines whether the function implementation given by impl can be executed by the current CPU.
impl : | a function implementation |
Returns : | 1 if the implementation can be executed, otherwise 0 |
void oil_class_choose_by_name (OilFunctionClass *klass, const char *name);
Sets the chosen implementation for the given function class to the implementation with the given name. If no implementation having the given name is found, the chosen implementation is not changed.
klass : | a function class |
name : | the name of an implementation |
void oil_class_register_impl_by_name (const char *klass_name, OilFunctionImpl *impl);
Adds impl to the list of implementations associated with the function class given by klass_name.
klass_name : | the name of the class |
impl : | an implementation |
<< liboildebug | liboilparameter >> |