public class CudaPheromone extends Pheromone implements CudaObject
Modifier and Type | Field and Description |
---|---|
protected jcuda.Pointer |
arrPointer |
protected jcuda.driver.CUdeviceptr |
testDevicePtr |
Constructor and Description |
---|
CudaPheromone(String name,
int width,
int height,
float evapPercentage,
float diffPercentage) |
CudaPheromone(String name,
int width,
int height,
int evapPercentage,
int diffPercentage) |
Modifier and Type | Method and Description |
---|---|
void |
diffusion() |
void |
diffusionAndEvaporation()
This is faster than calling them sequentially:
Only one GPU kernel is called.
|
void |
evaporation() |
void |
freeMemory() |
float |
get(int index)
access to underlying buffer
|
CudaEngine |
getCudaEngine() |
jcuda.Pointer |
getParamterPointer(jcuda.Pointer... kernelParameters) |
jcuda.Pointer |
getPointerToFloat(float f) |
FloatBuffer |
getValues() |
FloatBuffer |
getValuesFloatBuffer() |
jcuda.Pointer |
getValuesPinnedMemory() |
jcuda.driver.CUdeviceptr |
getValuesPtr() |
void |
initCuda() |
void |
initCudaArray() |
protected void |
initCudaParameters() |
void |
initCudaStream() |
void |
initCudaTmpGrid() |
void |
initCudaValues() |
protected void |
initFunctions() |
protected void |
launchKernel(jcuda.driver.CUfunction cUfunction,
jcuda.Pointer... parameters) |
void |
set(int index,
float value)
access to underlying buffer
|
void |
setCudaEngine(CudaEngine cudaEngine) |
void |
setValues(FloatBuffer values) |
void |
setValuesPinnedMemory(jcuda.Pointer valuesPinnedMemory) |
void |
setValuesPtr(jcuda.driver.CUdeviceptr valuesPtr) |
get, get1DIndex, getDiffusionCoefficient, getDiffusionPercentage, getEvaporationCoefficient, getEvaporationPercentage, getHeight, getMaxDirection, getMaximum, getMinDirection, getName, getWidth, incValue, incValue, set, setEvaporationPercentage, setMaximum, toString, updateFieldMaxDir
protected jcuda.Pointer arrPointer
protected jcuda.driver.CUdeviceptr testDevicePtr
public CudaPheromone(String name, int width, int height, int evapPercentage, int diffPercentage)
public CudaPheromone(String name, int width, int height, float evapPercentage, float diffPercentage)
public FloatBuffer getValues()
public void setValues(FloatBuffer values)
values
- the values to setpublic float get(int index)
Pheromone
public void set(int index, float value)
Pheromone
public void initCuda()
public void initCudaValues() throws InterruptedException, ExecutionException
public void initCudaTmpGrid() throws InterruptedException, ExecutionException
public void initCudaArray() throws InterruptedException, ExecutionException
public void initCudaStream() throws InterruptedException, ExecutionException
protected void initCudaParameters()
public jcuda.Pointer getParamterPointer(jcuda.Pointer... kernelParameters)
public jcuda.Pointer getPointerToFloat(float f)
protected void initFunctions()
protected void launchKernel(jcuda.driver.CUfunction cUfunction, jcuda.Pointer... parameters)
public CudaEngine getCudaEngine()
public void diffusionAndEvaporation()
diffusionAndEvaporation
in class Pheromone
public void evaporation()
evaporation
in class Pheromone
public void freeMemory()
freeMemory
in interface CudaObject
public FloatBuffer getValuesFloatBuffer()
getValuesFloatBuffer
in class Pheromone
public final void setCudaEngine(CudaEngine cudaEngine)
cudaEngine
- the cudaEngine to setpublic jcuda.driver.CUdeviceptr getValuesPtr()
public void setValuesPtr(jcuda.driver.CUdeviceptr valuesPtr)
valuesPtr
- the valuesPtr to setpublic jcuda.Pointer getValuesPinnedMemory()
public void setValuesPinnedMemory(jcuda.Pointer valuesPinnedMemory)
valuesPinnedMemory
- the valuesPinnedMemory to set