Class CudaLinker
java.lang.Object
com.ibm.cuda.CudaLinker
-
Constructor Summary
ConstructorDescriptionCudaLinker
(CudaDevice device) Creates a new linker for the specifieddevice
using default options.CudaLinker
(CudaDevice device, CudaJitOptions options) Creates a new linker for the specifieddevice
using the specifiedoptions
. -
Method Summary
Modifier and TypeMethodDescriptionadd
(CudaJitInputType type, byte[] data, String name) Adds a new code fragment to be linked into the module under construction using the default options.add
(CudaJitInputType type, byte[] data, String name, CudaJitOptions options) Adds a new code fragment to be linked into the module under construction using the specified options.add
(CudaJitInputType type, InputStream input, String name) Adds a new code fragment to be linked into the module under construction using the default options.add
(CudaJitInputType type, InputStream input, String name, CudaJitOptions options) Adds a new code fragment to be linked into the module under construction using the default options.byte[]
complete()
Completes the module under construction and return an image suitable for loading.void
destroy()
Destroys this linker, releasing associated resources.Returns the contents of the error log.Returns the contents of the information log.float
Answers the total elapsed time, in milliseconds, spent in the compiler and linker.
-
Constructor Details
-
CudaLinker
Creates a new linker for the specifieddevice
using default options.- Parameters:
device
- the device on which the resulting module is to be loaded- Throws:
CudaException
- if a CUDA exception occurs
-
CudaLinker
Creates a new linker for the specifieddevice
using the specifiedoptions
.- Parameters:
device
- the device on which the resulting module is to be loadedoptions
- the desired options, or null for the default options- Throws:
CudaException
- if a CUDA exception occurs
-
-
Method Details
-
add
Adds a new code fragment to be linked into the module under construction using the default options.- Parameters:
type
- the type of input datadata
- the content of the new code fragmentname
- the name to be used in log messages in reference to this code fragment- Returns:
- this linker object
- Throws:
CudaException
- if a CUDA exception occursIllegalStateException
- if this linker has been destroyed (seedestroy()
)
-
add
public CudaLinker add(CudaJitInputType type, byte[] data, String name, CudaJitOptions options) throws CudaException Adds a new code fragment to be linked into the module under construction using the specified options.- Parameters:
type
- the type of input datadata
- the content of the new code fragmentname
- the name to be used in log messages in reference to this code fragmentoptions
- the desired options- Returns:
- this linker object
- Throws:
CudaException
- if a CUDA exception occursIllegalStateException
- if this linker has been destroyed (seedestroy()
)
-
add
public CudaLinker add(CudaJitInputType type, InputStream input, String name) throws CudaException, IOException Adds a new code fragment to be linked into the module under construction using the default options.- Parameters:
type
- the type of input datainput
- the content of the new code fragmentname
- the name to be used in log messages in reference to this code fragment- Returns:
- this linker object
- Throws:
CudaException
- if a CUDA exception occursIllegalStateException
- if this linker has been destroyed (seedestroy()
)IOException
- if an I/O error occurs readinginput
-
add
public CudaLinker add(CudaJitInputType type, InputStream input, String name, CudaJitOptions options) throws CudaException, IOException Adds a new code fragment to be linked into the module under construction using the default options.- Parameters:
type
- the type of input datainput
- the content of the new code fragmentname
- the name to be used in log messages in reference to this code fragmentoptions
- the desired options- Returns:
- this linker object
- Throws:
CudaException
- if a CUDA exception occursIllegalStateException
- if this linker has been destroyed (seedestroy()
)IOException
- if an I/O error occurs readinginput
-
complete
Completes the module under construction and return an image suitable for loading.- Returns:
- the image suitable for loading
- Throws:
CudaException
- if a CUDA exception occursIllegalStateException
- if this linker has been destroyed (seedestroy()
)
-
destroy
Destroys this linker, releasing associated resources.- Throws:
CudaException
- if a CUDA exception occurs
-
getErrorLogBuffer
Returns the contents of the error log.The result will be empty unless this linker was created with options which specified a positive error log buffer size (see
CudaJitOptions.setErrorLogBufferSize(int)
) and errors were reported.- Returns:
- the contents of the error log
-
getInfoLogBuffer
Returns the contents of the information log.The result will be empty unless this linker was created with options which specified a positive information log buffer size (see
CudaJitOptions.setInfoLogBufferSize(int)
) and informational messages were reported.- Returns:
- the contents of the information log
-
getWallTime
public float getWallTime()Answers the total elapsed time, in milliseconds, spent in the compiler and linker.Applies to: compiler and linker.
- Returns:
- the total elapsed time, in milliseconds, spent in the compiler and linker
-