 cudaArray *d_volumeArray = 0;
 cudaArray *d_customTransferFuncArray;
 
-cudaArray *d_isoValArray = 0;
+//cudaArray *d_isoValArray = 0;
+__device__ float * d_isoValArray = 0;
 __device__ int d_numIsoVals = 0;
 
 std::vector<float> fpsVec;

void freeCudaBuffers() {
	checkCudaErrors(cudaFreeArray(d_volumeArray));
	checkCudaErrors(cudaFreeArray(d_customTransferFuncArray));
	checkCudaErrors(cudaFreeArray(d_isoValArray));
}



void transferIsoValues(float* h_isoVals, int h_numIsos) {

	if (d_isoValArray) {
		//checkCudaErrors(cudaFreeArray(d_isoValArray));
		checkCudaErrors(cudaFree(d_isoValArray));
		//d_isoValArray = 0; // not possible since it is a device pointer
	}

	/*cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc<VolumeType>();
	checkCudaErrors(cudaMallocArray(&d_isoValArray, &channelDesc, h_numIsos));
	checkCudaErrors(cudaMemcpyToArray(d_isoValArray, 0, 0, h_isoVals, sizeof(VolumeType)*h_numIsos, cudaMemcpyHostToDevice));*/

	checkCudaErrors(cudaMalloc(&d_isoValArray, h_numIsos * sizeof(VolumeType)));
	checkCudaErrors(cudaMemcpyToSymbol(d_isoValArray, &h_isoVals, h_numIsos * sizeof(VolumeType), 0, cudaMemcpyHostToDevice));

	checkCudaErrors(cudaMemcpyToSymbol(d_numIsoVals, &h_numIsos, sizeof(int), 0, cudaMemcpyHostToDevice));
}

extern "C"
