public final class CudaLinker
extends java.lang.Object
CudaLinker
class supports combining one or more code fragments
to form a module that can be then loaded on a CUDA-capable device.
When no longer required, a linker must be destroyed (see destroy()
).
Constructor and Description |
---|
CudaLinker(CudaDevice device)
Creates a new linker for the specified
device
using default options. |
CudaLinker(CudaDevice device,
CudaJitOptions options)
Creates a new linker for the specified
device
using the specified options . |
Modifier and Type | Method and Description |
---|---|
CudaLinker |
add(CudaJitInputType type,
byte[] data,
java.lang.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,
java.lang.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,
java.io.InputStream input,
java.lang.String name)
Adds a new code fragment to be linked into the module under construction
using the default options.
|
CudaLinker |
add(CudaJitInputType type,
java.io.InputStream input,
java.lang.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.
|
java.lang.String |
getErrorLogBuffer()
Returns the contents of the error log.
|
java.lang.String |
getInfoLogBuffer()
Returns the contents of the information log.
|
float |
getWallTime()
Answers the total elapsed time, in milliseconds,
spent in the compiler and linker.
|
public CudaLinker(CudaDevice device) throws CudaException
device
using default options.device
- the device on which the resulting module is to be loadedCudaException
- if a CUDA exception occurspublic CudaLinker(CudaDevice device, CudaJitOptions options) throws CudaException
device
using the specified options
.device
- the device on which the resulting module is to be loadedoptions
- the desired options, or null for the default optionsCudaException
- if a CUDA exception occurspublic CudaLinker add(CudaJitInputType type, byte[] data, java.lang.String name) throws CudaException
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 fragmentCudaException
- if a CUDA exception occursjava.lang.IllegalStateException
- if this linker has been destroyed (see destroy()
)public CudaLinker add(CudaJitInputType type, byte[] data, java.lang.String name, CudaJitOptions options) throws CudaException
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 optionsCudaException
- if a CUDA exception occursjava.lang.IllegalStateException
- if this linker has been destroyed (see destroy()
)public CudaLinker add(CudaJitInputType type, java.io.InputStream input, java.lang.String name) throws CudaException, java.io.IOException
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 fragmentCudaException
- if a CUDA exception occursjava.lang.IllegalStateException
- if this linker has been destroyed (see destroy()
)java.io.IOException
- if an I/O error occurs reading input
public CudaLinker add(CudaJitInputType type, java.io.InputStream input, java.lang.String name, CudaJitOptions options) throws CudaException, java.io.IOException
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 optionsCudaException
- if a CUDA exception occursjava.lang.IllegalStateException
- if this linker has been destroyed (see destroy()
)java.io.IOException
- if an I/O error occurs reading input
public byte[] complete() throws CudaException
CudaException
- if a CUDA exception occursjava.lang.IllegalStateException
- if this linker has been destroyed (see destroy()
)public void destroy() throws CudaException
CudaException
- if a CUDA exception occurspublic java.lang.String getErrorLogBuffer()
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.
public java.lang.String getInfoLogBuffer()
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.
public float getWallTime()
Applies to: compiler and linker.
Eclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 2013, 2025 IBM Corp. and others.