missing toString() methods added

define_list_fix
shamanDevel 9 years ago
parent 65164e2075
commit eb07d69cd8
  1. 7
      jme3-core/src/main/java/com/jme3/opencl/Buffer.java
  2. 6
      jme3-core/src/main/java/com/jme3/opencl/Context.java
  3. 22
      jme3-core/src/main/java/com/jme3/opencl/Image.java
  4. 34
      jme3-core/src/main/java/com/jme3/opencl/Kernel.java
  5. 5
      jme3-jogl/src/main/java/com/jme3/opencl/jocl/JoclPlatform.java
  6. 5
      jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java
  7. 5
      jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java

@ -423,5 +423,10 @@ public abstract class Buffer extends AbstractOpenCLObject {
//default implementation, overwrite for better performance
releaseBufferForSharingAsync(queue).release();
}
@Override
public String toString() {
return "Buffer (" + getSize() + "B)";
}
}

@ -436,4 +436,10 @@ public abstract class Context extends AbstractOpenCLObject {
* @return the new program
*/
public abstract Program createProgramFromBinary(ByteBuffer binaries, Device device);
@Override
public String toString() {
return "Context (" + getDevices() + ')';
}
}

@ -532,6 +532,26 @@ memory layout in which channels are stored in the image.
//default implementation, overwrite it for performance improvements
releaseImageForSharingAsync(queue).release();
}
@Override
public String toString() {
StringBuilder str = new StringBuilder();
str.append("Image (");
ImageType t = getImageType();
str.append(t);
str.append(", w=").append(getWidth());
if (t == ImageType.IMAGE_2D || t == ImageType.IMAGE_3D) {
str.append(", h=").append(getHeight());
}
if (t == ImageType.IMAGE_3D) {
str.append(", d=").append(getDepth());
}
if (t == ImageType.IMAGE_1D_ARRAY || t == ImageType.IMAGE_2D_ARRAY) {
str.append(", arrays=").append(getArraySize());
}
str.append(", ").append(getImageFormat());
str.append(')');
return str.toString();
}
//TODO: add variants of the above two methods that don't create the event object, but release the event immediately
}

@ -424,7 +424,12 @@ public abstract class Kernel extends AbstractOpenCLObject {
setArgs(args);
RunNoEvent(queue);
}
@Override
public String toString() {
return "Kernel (" + getName() + ")";
}
/**
* A placeholder for kernel arguments representing local kernel memory.
* This defines the size of available shared memory of a {@code __shared} kernel
@ -468,6 +473,12 @@ public abstract class Kernel extends AbstractOpenCLObject {
}
return true;
}
@Override
public String toString() {
return "LocalMem (" + size + "B)";
}
}
/**
@ -519,6 +530,12 @@ public abstract class Kernel extends AbstractOpenCLObject {
}
return true;
}
@Override
public String toString() {
return "LocalMemPerElement (" + size + "B)";
}
}
/**
@ -623,6 +640,21 @@ public abstract class Kernel extends AbstractOpenCLObject {
}
return true;
}
@Override
public String toString() {
StringBuilder str = new StringBuilder();
str.append("WorkSize[");
for (int i=0; i<dimension; ++i) {
if (i>0) {
str.append(", ");
}
str.append(sizes[i]);
}
str.append(']');
return str.toString();
}
}
}

@ -124,4 +124,9 @@ public final class JoclPlatform implements Platform {
return platform.getExtensions();
}
@Override
public String toString() {
return getName();
}
}

@ -124,4 +124,9 @@ public final class LwjglPlatform implements Platform {
return Arrays.asList(platform.getInfoString(CL10.CL_PLATFORM_EXTENSIONS).split(" "));
}
@Override
public String toString() {
return getName();
}
}

@ -125,4 +125,9 @@ public final class LwjglPlatform implements Platform {
return Arrays.asList(Info.clGetPlatformInfoStringASCII(platform.address(), CL10.CL_PLATFORM_EXTENSIONS).split(" "));
}
@Override
public String toString() {
return getName();
}
}

Loading…
Cancel
Save