// Path: src/main/java/org/shaman/jmecl/OpenCLSettings.java
// public class OpenCLSettings {
// 	
// 	private final Context clContext;
// 	private final CommandQueue clCommandQueue;
// 	private final ProgramCache programCache;
// 	private final AssetManager assetManager;
// 
// 	public OpenCLSettings(Context clContext, CommandQueue clCommandQueue, 
// 			ProgramCache programCache, AssetManager assetManager) {
// 		this.clContext = clContext;
// 		this.clCommandQueue = clCommandQueue;
// 		this.programCache = programCache!=null ? programCache : new ProgramCache();
// 		this.assetManager = assetManager;
// 	}
// 
// 	public Context getClContext() {
// 		return clContext;
// 	}
// 
// 	public CommandQueue getClCommandQueue() {
// 		return clCommandQueue;
// 	}
// 
// 	public ProgramCache getProgramCache() {
// 		return programCache;
// 	}
// 
// 	public AssetManager getAssetManager() {
// 		return assetManager;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		int hash = 3;
// 		hash = 43 * hash + Objects.hashCode(this.clContext);
// 		hash = 43 * hash + Objects.hashCode(this.clCommandQueue);
// 		return hash;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (obj == null) {
// 			return false;
// 		}
// 		if (getClass() != obj.getClass()) {
// 			return false;
// 		}
// 		final OpenCLSettings other = (OpenCLSettings) obj;
// 		if (!Objects.equals(this.clContext, other.clContext)) {
// 			return false;
// 		}
// 		if (!Objects.equals(this.clCommandQueue, other.clCommandQueue)) {
// 			return false;
// 		}
// 		return true;
// 	}
// 
// }


import com.jme3.opencl.*;
import java.nio.ByteBuffer;
import java.util.AbstractMap;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
import org.shaman.jmecl.OpenCLSettings;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.shaman.jmecl.utils;


/**
 * Collection of utitlity and blas-level-1 routines on primitive types.
 * <p>
 * All operations take the following arguments:
 * <ul>
 *  <li>{@code size} the size or number of elements that the operation should process </li>
 *  <li>{@code step} the step size in the array, must be non-zero </li>
 *  <li>{@code offset} the offset into the array, must be non-negative </li>
 * </ul>
 * The passed buffers are adressed as they would be arrays of type {@code T}:
 * {@code T val = buffer[index * step + offset]} with {@code index} ranging from {@code 0}
 * to {@code size-1}. <br>
 * It must be ensured that the passed buffer large enough so that no element outside
 * the bounds is accessed.
 * 
 * 
 * @author Sebastian Weiss
 * @param <T> the number type, Float, Double, Integer and Long are supported
 */
public final class CLBlas<T extends Number> {
	private static final Logger LOG = Logger.getLogger(CLBlas.class.getName());
	private static final String FILE = "org/shaman/jmecl/utils/CLBlas.cl";
	
// Path: src/main/java/org/shaman/jmecl/OpenCLSettings.java
// public class OpenCLSettings {
// 	
// 	private final Context clContext;
// 	private final CommandQueue clCommandQueue;
// 	private final ProgramCache programCache;
// 	private final AssetManager assetManager;
// 
// 	public OpenCLSettings(Context clContext, CommandQueue clCommandQueue, 
// 			ProgramCache programCache, AssetManager assetManager) {
// 		this.clContext = clContext;
// 		this.clCommandQueue = clCommandQueue;
// 		this.programCache = programCache!=null ? programCache : new ProgramCache();
// 		this.assetManager = assetManager;
// 	}
// 
// 	public Context getClContext() {
// 		return clContext;
// 	}
// 
// 	public CommandQueue getClCommandQueue() {
// 		return clCommandQueue;
// 	}
// 
// 	public ProgramCache getProgramCache() {
// 		return programCache;
// 	}
// 
// 	public AssetManager getAssetManager() {
// 		return assetManager;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		int hash = 3;
// 		hash = 43 * hash + Objects.hashCode(this.clContext);
// 		hash = 43 * hash + Objects.hashCode(this.clCommandQueue);
// 		return hash;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (obj == null) {
// 			return false;
// 		}
// 		if (getClass() != obj.getClass()) {
// 			return false;
// 		}
// 		final OpenCLSettings other = (OpenCLSettings) obj;
// 		if (!Objects.equals(this.clContext, other.clContext)) {
// 			return false;
// 		}
// 		if (!Objects.equals(this.clCommandQueue, other.clCommandQueue)) {
// 			return false;
// 		}
// 		return true;
// 	}
// 
// }


// Path: src/main/java/org/shaman/jmecl/utils/CLBlas.java
import com.jme3.opencl.*;
import java.nio.ByteBuffer;
import java.util.AbstractMap;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
import org.shaman.jmecl.OpenCLSettings;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.shaman.jmecl.utils;


/**
 * Collection of utitlity and blas-level-1 routines on primitive types.
 * <p>
 * All operations take the following arguments:
 * <ul>
 *  <li>{@code size} the size or number of elements that the operation should process </li>
 *  <li>{@code step} the step size in the array, must be non-zero </li>
 *  <li>{@code offset} the offset into the array, must be non-negative </li>
 * </ul>
 * The passed buffers are adressed as they would be arrays of type {@code T}:
 * {@code T val = buffer[index * step + offset]} with {@code index} ranging from {@code 0}
 * to {@code size-1}. <br>
 * It must be ensured that the passed buffer large enough so that no element outside
 * the bounds is accessed.
 * 
 * 
 * @author Sebastian Weiss
 * @param <T> the number type, Float, Double, Integer and Long are supported
 */
public final class CLBlas<T extends Number> {
	private static final Logger LOG = Logger.getLogger(CLBlas.class.getName());
	private static final String FILE = "org/shaman/jmecl/utils/CLBlas.cl";
	
	private static final Map<OpenCLSettings, Map<Class<? extends Number>, CLBlas<? extends Number>>> instances