Skip to content

Commit

Permalink
opencl: Remove unused code
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jun 3, 2017
1 parent 34bdf99 commit 1cf098d
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions opencl/openclwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,6 @@ static const l_uint32 rmask32[] = {
0x01ffffff, 0x03ffffff, 0x07ffffff, 0x0fffffff, 0x1fffffff, 0x3fffffff,
0x7fffffff, 0xffffffff};

struct tiff_transform {
int vflip; /* if non-zero, image needs a vertical fip */
int hflip; /* if non-zero, image needs a horizontal flip */
int rotate; /* -1 -> counterclockwise 90-degree rotation,
0 -> no rotation
1 -> clockwise 90-degree rotation */
};

static struct tiff_transform tiff_orientation_transforms[] = {
{0, 0, 0},
{0, 1, 0},
{1, 1, 0},
{1, 0, 0},
{0, 1, -1},
{0, 0, 1},
{0, 1, 1},
{0, 0, -1}
};

static const l_int32 MAX_PAGES_IN_TIFF_FILE = 3000;

static cl_mem pixsCLBuffer, pixdCLBuffer, pixdCLIntermediate; //Morph operations buffers
static cl_mem pixThBuffer; //output from thresholdtopix calculation
static cl_int clStatus;
Expand Down Expand Up @@ -727,31 +706,6 @@ Pix *mapOutputCLBuffer(KernelEnv rEnv, cl_mem clbuffer, Pix *pixd, Pix *pixs,
return pixd;
}

static cl_mem allocateIntBuffer(KernelEnv rEnv, const l_uint32 *_pValues,
size_t nElements, cl_int *pStatus,
bool sync = false)
{
cl_mem xValues =
clCreateBuffer(rEnv.mpkContext, (cl_mem_flags)(CL_MEM_READ_WRITE),
nElements * sizeof(l_int32), nullptr, pStatus);

if (_pValues != nullptr) {
l_int32 *pValues = (l_int32 *)clEnqueueMapBuffer(
rEnv.mpkCmdQueue, xValues, CL_TRUE, CL_MAP_WRITE, 0,
nElements * sizeof(l_int32), 0, nullptr, nullptr, nullptr);

memcpy(pValues, _pValues, nElements * sizeof(l_int32));

clEnqueueUnmapMemObject(rEnv.mpkCmdQueue, xValues, pValues, 0, nullptr,
nullptr);

if (sync) clFinish(rEnv.mpkCmdQueue);
}

return xValues;
}


void OpenclDevice::releaseMorphCLBuffers()
{
if (pixdCLIntermediate != nullptr) clReleaseMemObject(pixdCLIntermediate);
Expand Down

0 comments on commit 1cf098d

Please sign in to comment.