OpenNet
Public Member Functions | List of all members
OpenNet::Kernel Class Reference

The Kernel class. More...

#include <Kernel.h>

Inheritance diagram for OpenNet::Kernel:
OpenNet::SourceCode OpenNet::StatisticsProvider OpenNet::Kernel_Forward

Public Member Functions

OPEN_NET_PUBLIC Kernel ()
 Constructor.
 
OPEN_NET_PUBLIC Status DisableProfiling ()
 Disable OpenCL profiling. More...
 
OPEN_NET_PUBLIC Status EnableProfiling ()
 Enable OpenCL profiling. More...
 
OPEN_NET_PUBLIC const char * GetBuildLog () const
 Retrieve the build log. More...
 
OPEN_NET_PUBLIC unsigned int GetCodeLineCount ()
 Retrieve the code line count. More...
 
OPEN_NET_PUBLIC const char ** GetCodeLines ()
 Retrieve the code lines. More...
 
OPEN_NET_PUBLIC void * GetCommandQueue ()
 Retrieve the command queue running this kernel. More...
 
OPEN_NET_PUBLIC bool IsProfilingEnabled () const
 Is the OpenCL profiling enabled? More...
 
OPEN_NET_PUBLIC Status SetStaticUserArgument (unsigned int aIndex, UserBuffer *aArg)
 Add a user argument always passed to the kernel. More...
 
virtual OPEN_NET_PUBLIC void SetUserKernelArgs (void *aKernel)
 Called to add user arguments to the kernel. More...
 
virtual OPEN_NET_PUBLIC void SetUserKernelArgs (void **aArguments)
 Called to add user arguments to the kernel. More...
 
virtual OPEN_NET_PUBLIC Status AppendCode (const char *aCode, unsigned int aCodeSize_byte)
 Appen code. More...
 
virtual OPEN_NET_PUBLIC Status ResetCode ()
 Reset the code. More...
 
virtual OPEN_NET_PUBLIC Status SetCode (const char *aFileName)
 Set the code using a source file. More...
 
virtual OPEN_NET_PUBLIC Status SetCode (const char *aCode, unsigned int aCodeSize_byte)
 Set the code. More...
 
virtual OPEN_NET_PUBLIC Status Display (FILE *aOut) const
 Display. More...
 
virtual OPEN_NET_PUBLIC unsigned int Edit_Remove (const char *aSearch)
 Remove strings from code. More...
 
virtual OPEN_NET_PUBLIC unsigned int Edit_Replace (const char *aSearch, const char *aReplace)
 Replace strings in code. More...
 
virtual OPEN_NET_PUBLIC Status GetStatistics (unsigned int *aOut, unsigned int aOutSize_byte, unsigned int *aInfo_byte, bool aReset)
 This methode return the statistics of the adapter. More...
 
virtual OPEN_NET_PUBLIC Status ResetStatistics ()
 This methode resets the statistics of the adapter. More...
 
- Public Member Functions inherited from OpenNet::SourceCode
OPEN_NET_PUBLIC SourceCode ()
 Constructor.
 
virtual OPEN_NET_PUBLIC ~SourceCode ()
 Destructor.
 
OPEN_NET_PUBLIC Status AppendCode (const char *aFileName)
 Append code using a source file. More...
 
OPEN_NET_PUBLIC Status AppendCode (const SourceCode &aCode)
 Appen code. More...
 
OPEN_NET_PUBLIC unsigned int GetCodeSize () const
 Get code size. More...
 
OPEN_NET_PUBLIC const char * GetName () const
 Retrieve the instance name. More...
 
virtual OPEN_NET_PUBLIC Status SetArgumentCount (unsigned int aArgCount)
 Set the number of argument for the function or kernel. More...
 
OPEN_NET_PUBLIC Status SetName (const char *aName)
 Set the instance's name. More...
 
OPEN_NET_PUBLIC unsigned int Edit_Search (const char *aSearch)
 Search string in code. More...
 
- Public Member Functions inherited from OpenNet::StatisticsProvider
OPEN_NET_PUBLIC unsigned int GetStatisticsQty () const
 This methode returns the number of statistics counter. More...
 
const OPEN_NET_PUBLIC StatisticsDescriptionGetStatisticsDescriptions () const
 This methode returns the statistics counter descriptions. More...
 
OPEN_NET_PUBLIC Status DisplayStatistics (const unsigned int *aIn, unsigned int aInSize_byte, FILE *aOut, unsigned int aMinLevel=0)
 Display. More...
 

Detailed Description

The Kernel class.

Member Function Documentation

virtual OPEN_NET_PUBLIC Status OpenNet::Kernel::AppendCode ( const char *  aCode,
unsigned int  aCodeSize_byte 
)
virtual

Appen code.

Parameters
aCodeThe code
aCodeSize_byteLa taille du code
Return values
STATUS_OK
STATUS_CODE_ALREADY_SET
STATUS_EMPTY_CODE

Reimplemented from OpenNet::SourceCode.

OPEN_NET_PUBLIC Status OpenNet::Kernel::DisableProfiling ( )

Disable OpenCL profiling.

Return values
STATUS_OK
STATUS_PROFILING_ALREADY_DISABLED
See also
EnableProfiling, IsProfilingEnabled
virtual OPEN_NET_PUBLIC Status OpenNet::Kernel::Display ( FILE *  aOut) const
virtual

Display.

Parameters
aOutThe output stream
Return values
STATUS_OK
STATUS_NOT_ALLOWER_NULL_ARGUMENT

Reimplemented from OpenNet::SourceCode.

Reimplemented in OpenNet::Kernel_Forward.

virtual OPEN_NET_PUBLIC unsigned int OpenNet::Kernel::Edit_Remove ( const char *  aSearch)
virtual

Remove strings from code.

Parameters
aSearchThe string to search for and remove
Returns
This method returns the number of removed string.

Reimplemented from OpenNet::SourceCode.

virtual OPEN_NET_PUBLIC unsigned int OpenNet::Kernel::Edit_Replace ( const char *  aSearch,
const char *  aReplace 
)
virtual

Replace strings in code.

Parameters
aSearchThe string to search for
aReplaceThe string to use for replacing found strings
Returns
This method returns the number of replacement.

Reimplemented from OpenNet::SourceCode.

OPEN_NET_PUBLIC Status OpenNet::Kernel::EnableProfiling ( )

Enable OpenCL profiling.

Return values
STATUS_OK
STATUS_PROFILING_ALREADY_ENABLED
See also
DisableProfiling, IsProfilingEnabled
OPEN_NET_PUBLIC const char* OpenNet::Kernel::GetBuildLog ( ) const

Retrieve the build log.

Returns
This method returns the address of an internal buffer.
OPEN_NET_PUBLIC unsigned int OpenNet::Kernel::GetCodeLineCount ( )

Retrieve the code line count.

Returns
This method returns the code line cout.
OPEN_NET_PUBLIC const char** OpenNet::Kernel::GetCodeLines ( )

Retrieve the code lines.

Returns
This method returns the address of an internal buffer.
OPEN_NET_PUBLIC void* OpenNet::Kernel::GetCommandQueue ( )

Retrieve the command queue running this kernel.

Return values
NULLThe command queue is not assigned
OtherA valid cl_command_queue value
virtual OPEN_NET_PUBLIC Status OpenNet::Kernel::GetStatistics ( unsigned int *  aOut,
unsigned int  aOutSize_byte,
unsigned int *  aInfo_byte,
bool  aReset 
)
virtual

This methode return the statistics of the adapter.

Parameters
aOutThe methode return the statistics here.
aOutSize_byteThe output buffer size
aInfo_byteThe returned size
aResetReset statistics to 0
Return values
STATUS_OK
STATUS_IOCTL_ERROR
STATUS_NOT_ALLOWER_NULL_ARGUMENT

Implements OpenNet::StatisticsProvider.

bool OpenNet::Kernel::IsProfilingEnabled ( ) const
inline

Is the OpenCL profiling enabled?

Note
This method is part of the critical path.
Return values
false
true
See also
DisableProfiling, EnableProfiling
virtual OPEN_NET_PUBLIC Status OpenNet::Kernel::ResetCode ( )
virtual

Reset the code.

Return values
STATUS_OK
STATUS_CODE_NOT_SET

Reimplemented from OpenNet::SourceCode.

virtual OPEN_NET_PUBLIC Status OpenNet::Kernel::ResetStatistics ( )
virtual

This methode resets the statistics of the adapter.

Return values
STATUS_OK
STATUS_IOCTL_ERROR

Implements OpenNet::StatisticsProvider.

virtual OPEN_NET_PUBLIC Status OpenNet::Kernel::SetCode ( const char *  aFileName)
virtual

Set the code using a source file.

Parameters
aFileNameThe source file name
Return values
STATUS_OK
STATUS_CANNOT_OPEN_INPUT_FILE
STATUS_CANNOT_READ_INPUT_FILE
STATUS_CODE_ALREADY_SET
STATUS_EMPTY_INPUT_FILE
STATUS_ERROR_CLOSING_INPUT_FILE
STATUS_ERROR_READING_INPUT_FILE
STATUS_INPUT_FILE_TOO_LARGE

Reimplemented from OpenNet::SourceCode.

virtual OPEN_NET_PUBLIC Status OpenNet::Kernel::SetCode ( const char *  aCode,
unsigned int  aCodeSize_byte 
)
virtual

Set the code.

Parameters
aCodeThe code
aCodeSize_byteLa taille du code
Return values
STATUS_OK
STATUS_CODE_ALREADY_SET
STATUS_EMPTY_CODE

Reimplemented from OpenNet::SourceCode.

OPEN_NET_PUBLIC Status OpenNet::Kernel::SetStaticUserArgument ( unsigned int  aIndex,
UserBuffer aArg 
)

Add a user argument always passed to the kernel.

Parameters
aIndexThe argument index
aArgThe argument
Return values
false
true
See also
Processor::AllocateUserBuffer
virtual OPEN_NET_PUBLIC void OpenNet::Kernel::SetUserKernelArgs ( void *  aKernel)
virtual

Called to add user arguments to the kernel.

Parameters
aKernelThe cl_kernel instance
virtual OPEN_NET_PUBLIC void OpenNet::Kernel::SetUserKernelArgs ( void **  aArguments)
virtual

Called to add user arguments to the kernel.

Parameters
aArgumentsArgument vector to fill

The documentation for this class was generated from the following file: