- java.lang.Object
-
- com.ibm.cuda.CudaLinker
-
-
Constructor Summary
Constructors Constructor Description CudaLinker(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CudaLinker
add(CudaJitInputType type, byte[] data, String name)
Adds a new code fragment to be linked into the module under construction using the default options.CudaLinker
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.CudaLinker
add(CudaJitInputType type, InputStream input, String name)
Adds a new code fragment to be linked into the module under construction using the default options.CudaLinker
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.String
getErrorLogBuffer()
Returns the contents of the error log.String
getInfoLogBuffer()
Returns the contents of the information log.float
getWallTime()
Answers the total elapsed time, in milliseconds, spent in the compiler and linker.
-
-
-
Constructor Detail
-
CudaLinker
public CudaLinker(CudaDevice device) throws CudaException
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
public CudaLinker(CudaDevice device, CudaJitOptions options) throws CudaException
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 Detail
-
add
public CudaLinker add(CudaJitInputType type, byte[] data, String name) throws CudaException
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
public byte[] complete() throws CudaException
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
public void destroy() throws CudaException
Destroys this linker, releasing associated resources.- Throws:
CudaException
- if a CUDA exception occurs
-
getErrorLogBuffer
public String 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
public String 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
-
-