/*
* This sample implements a separable convolution
* of a 2D image with an arbitrary filter.
*/

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

unsigned int filter_radius;

#define FILTER_LENGTH (2 * filter_radius + 1)
#define ABS(val) ((val) < 0.0 ? (-(val)) : (val))
#define accuracy 0.00005
#define ArraySize imageW *imageH
#define ERROR -1
#define FILTER_R_X2 2*filter_radius
#define SH_MEM_SIZE 32
#define NUMBLOCKS 4

typedef double dataType;
__constant__ dataType d_Filter[65536/sizeof(dataType)];

// This checks for cuda errors
#define cudaErrorCheck()                                                                                 \
  {                                                                                                      \
    cudaError_t error = cudaGetLastError();                                                              \
    if (error != cudaSuccess)                                                                            \
    {                                                                                                    \
      printf("Cuda Error Found %s:%d:  '%s'\n", __FILE__, __LINE__, cudaGetErrorString(error));          \
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU); \
      return (ERROR);                                                                                    \
    }                                                                                                    \
  }

#define cudaCalloc(pointer, size, sizeOfElement)                                                         \
  {                                                                                                      \
    cudaError_t err = cudaMalloc(pointer, size * sizeOfElement);                                         \
    if (err != cudaSuccess)                                                                              \
    {                                                                                                    \
      printf("Error allocating memory on host:   %s\n", cudaGetErrorString(err));                        \
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU); \
      return (ERROR);                                                                                    \
    }                                                                                                    \
    cudaMemset(*pointer, 0.0, size *sizeOfElement);                                                      \
  }

////////////////////////////////////////////////////////////////////////////////
// Kernel Row Convolution Filter
////////////////////////////////////////////////////////////////////////////////
__global__ void convolutionRow(dataType *Input, dataType *Output, int filterR, int imageW)
{
  dataType sum = 0;
  int d, k;

  int ix = blockIdx.x * blockDim.x + threadIdx.x + filterR;
  int iy = blockIdx.y * blockDim.y + threadIdx.y + filterR;
  //int dimx = blockDim.x * gridDim.x + 2 * filterR;
  //int idx = iy * dimx + ix;
  int imageWithPaddingW = imageW + 2 * filterR;

  for (k = -filterR; k <= filterR; k++)
  {
    d = ix + k;
    sum += Input[iy * imageWithPaddingW + d] * d_Filter[filterR - k];
  }
  Output[iy * imageWithPaddingW + ix] = sum; //Only 1 time for each thread
}


////////////////////////////////////////////////////////////////////////////////
// Kernel Column Convolution Filter
////////////////////////////////////////////////////////////////////////////////
__global__ void convolutionColumn(dataType *Input, dataType *Output, int filterR, int imageW, int imageH)
{
  dataType sum = 0;
  int d, k;

  int ix = blockIdx.x * blockDim.x + threadIdx.x + filterR;
  int iy = blockIdx.y * blockDim.y + threadIdx.y + filterR;

  int imageWithPaddingW = imageW + 2 * filterR;

  for (k = -filterR; k <= filterR; k++)
  {
    d = iy + k;

    sum += Input[d * imageWithPaddingW + ix] * d_Filter[filterR - k];

    Output[iy * imageWithPaddingW + ix] = sum;
  }
}


////////////////////////////////////////////////////////////////////////////////
// Kernel Row Convolution Filter using Shared Memory
////////////////////////////////////////////////////////////////////////////////
__global__ void convolutionRowSharedMem(dataType *Input, dataType *Output, int filterR, int imageW, int SH_MEM_SIZE_PAD)
{
  dataType sum = 0;
  int d, k;

  int tx = threadIdx.x + filterR;
  int ix = blockIdx.x * blockDim.x + threadIdx.x + filterR;
  int iy = blockIdx.y * blockDim.y + threadIdx.y + filterR;

  //indexes in arrays including padding
  int ptx = threadIdx.x;
  int pty = threadIdx.y;
  int pix = blockIdx.x * blockDim.x + threadIdx.x;

  int imageWithPaddingW = imageW + 2 * filterR;

  //shared memory for Input
  extern __shared__ dataType s_Input[]; // shared memory with padding

  //collaboratively load tiles into __shared__
  for (int i = 0; i < SH_MEM_SIZE_PAD/32; i++){
    s_Input[pty * SH_MEM_SIZE_PAD + (SH_MEM_SIZE_PAD / 32) * ptx + i] = Input[iy * imageWithPaddingW + (SH_MEM_SIZE_PAD / 32) * pix + i - ((SH_MEM_SIZE_PAD / 32) - 1) * (blockIdx.x * blockDim.x)];
  }

  __syncthreads();

  for (k = -filterR; k <= filterR; k++)
  {
    d = tx + k;
    sum += s_Input[pty * SH_MEM_SIZE_PAD + d] * d_Filter[filterR - k];
  }
  Output[iy * imageWithPaddingW + ix] = sum; //1 time for each thread
}


////////////////////////////////////////////////////////////////////////////////
// Kernel Column Convolution Filter using Shared Memory
////////////////////////////////////////////////////////////////////////////////
__global__ void convolutionColumnSharedMem(dataType *Input, dataType *Output, int filterR, int imageW, int imageH, int SH_MEM_SIZE_PAD)
{
  dataType sum = 0;
  int d, k;

  int ty = threadIdx.y + filterR;
  int ix = blockIdx.x * blockDim.x + threadIdx.x + filterR;
  int iy = blockIdx.y * blockDim.y + threadIdx.y + filterR;

  //indexes in arrays including padding
  int ptx = threadIdx.x;
  int pty = threadIdx.y;
  int piy = blockIdx.y * blockDim.y + pty;

  int imageWithPaddingW = imageW + 2 * filterR;

  //shared memory for Input
  extern __shared__ dataType s_Input[];

  //collaboratively load tiles into __shared__
  for (int i = 0; i < SH_MEM_SIZE_PAD/32; i++){
    s_Input[(pty * (SH_MEM_SIZE_PAD / 32) + i) * SH_MEM_SIZE + ptx] = Input[(piy * (SH_MEM_SIZE_PAD / 32) + i - ((SH_MEM_SIZE_PAD / 32) - 1)*(blockIdx.y * blockDim.y)) * imageWithPaddingW + ix];
  }
  __syncthreads();

  for (k = -filterR; k <= filterR; k++)
  {
    d = ty + k;
    sum += s_Input[d * SH_MEM_SIZE + ptx] * d_Filter[filterR - k];
  }
  Output[iy * imageWithPaddingW + ix] = sum; //One time for each thread
}


////////////////////////////////////////////////////////////////////////////////
// Reference row convolution filter
////////////////////////////////////////////////////////////////////////////////
void convolutionRowCPU(dataType *h_Dst, dataType *h_Src, dataType *h_Filter,
int imageW, int imageH, int filterR)
{
  int x, y, k;
  int imageWithPaddingW = imageW + 2 * filterR;

  for (y = filterR; y < (imageH + filterR); y++)
  {
    for (x = filterR; x < (imageW + filterR); x++)
    {
      dataType sum = 0;

      for (k = -filterR; k <= filterR; k++)
      {
        int d = x + k;
        sum += h_Src[y * imageWithPaddingW + d] * h_Filter[filterR - k];
      }
      h_Dst[y * imageWithPaddingW + x] = sum; //One time for each x & y
    }
  }
}


////////////////////////////////////////////////////////////////////////////////
// Reference column convolution filter
////////////////////////////////////////////////////////////////////////////////
void convolutionColumnCPU(dataType *h_Dst, dataType *h_Src, dataType *h_Filter,
int imageW, int imageH, int filterR)
{
  int x, y, k;
  int imageWithPaddingW = imageW + 2 * filterR;

  for (y = filterR; y < (imageH + filterR); y++)
  {
    for (x = filterR; x < (imageW + filterR); x++)
    {
      dataType sum = 0;

      for (k = -filterR; k <= filterR; k++)
      {
        int d = y + k;
        sum += h_Src[d * imageWithPaddingW + x] * h_Filter[filterR - k];
      }
      h_Dst[y * imageWithPaddingW + x] = sum; //One time for each x & y
    }
  }
}

////////////////////////////////////////////////////////////////////////////////
// Free Alocated Host and Device Memory
////////////////////////////////////////////////////////////////////////////////
int freeMemory(dataType *h_Filter, dataType *h_Input, dataType *h_Buffer, dataType *h_OutputCPU, dataType *h_OutputGPU, dataType *d_Input, dataType *d_Buffer, dataType *d_OutputGPU)
{
  cudaError_t err;

  // free all the allocated memory for the host
  printf("Free host memory...\n");
  if (h_OutputGPU != NULL)
  {
    free(h_OutputGPU);
  }
  if (h_OutputCPU != NULL)
  {
    free(h_OutputCPU);
  }
  if (h_Buffer != NULL)
  {
    free(h_Buffer);
  }
  if (h_Input != NULL)
  {
    free(h_Input);
  }
  if (h_Filter != NULL)
  {
    free(h_Filter);
  }

  //free all the allocated device (GPU) memory
  printf("Free device memory...\n");
  if (d_OutputGPU != NULL)
  {
    err = cudaFree(d_OutputGPU);
    if (err != cudaSuccess)
    {
      printf("Error during cudaFree (d_OutputGPU):  %s\n", cudaGetErrorString(err));
      return (ERROR);
    }
  }
  if (d_Buffer != NULL)
  {
    err = cudaFree(d_Buffer);
    if (err != cudaSuccess)
    {
      printf("Error during cudaFree (d_Buffer):  %s\n", cudaGetErrorString(err));
      return (ERROR);
    }
  }
  if (d_Input != NULL)
  {
    err = cudaFree(d_Input);
    if (err != cudaSuccess)
    {
      printf("Error during cudaFree (d_Input):  %s\n", cudaGetErrorString(err));
      return (ERROR);
    }
  }

  // Do a device reset just in case... Bgalte to sxolio otan ylopoihsete CUDA
  printf("Reset Device\n");
  err = cudaDeviceReset();
  if (err != cudaSuccess)
  {
    printf("Error during cudaDeviceReset:  %s\n", cudaGetErrorString(err));
    return (ERROR);
  }

  return (0);
}

////////////////////////////////////////////////////////////////////////////////
// Main program
////////////////////////////////////////////////////////////////////////////////
int main(int argc, char **argv)
{

  //pointers for the host
  dataType
      *h_Filter = NULL,
      *h_Input = NULL,
      *h_Buffer = NULL,
      *h_OutputCPU = NULL,
      *h_OutputGPU = NULL;

  //pointers for the device
  dataType
      *d_Input = NULL,
      *d_Buffer = NULL,
      *d_OutputGPU = NULL;

  int imageW; //image width = N
  int imageH; //image height = N
  unsigned int i, j, block_size, numberOfBlocks;
  dataType diff = 0, max_diff = 0;

  /*-------timing variables-------*/
  struct timespec tv1, tv2;
  cudaError_t err;
  cudaEvent_t start;
  cudaEvent_t stop;
  float elapsed;
  /*------------------------------*/

  /*------padding variables-------*/
  int imageWithPaddingW, newImageSize;
  /*------------------------------*/

  printf("Enter filter radius : ");
  scanf("%d", &filter_radius);

  // Ta imageW, imageH ta dinei o xrhsths kai thewroume oti einai isa,
  // dhladh imageW = imageH = N, opou to N to dinei o xrhsths.
  // Gia aplothta thewroume tetragwnikes eikones.

  printf("Enter image size. Should be a power of two and greater than %d : ", FILTER_LENGTH);
  scanf("%d", &imageW); //TODO Warning
  imageH = imageW;

  imageWithPaddingW = imageW + 2 * filter_radius;
  newImageSize = imageWithPaddingW * imageWithPaddingW;

  printf("Image Width x Height = %i x %i\n\n", imageW, imageH);
  printf("Image Width x Height = %i x %i\n\n", imageWithPaddingW, imageWithPaddingW);
  printf("Allocating and initializing host arrays...\n");

  //Allocate host (CPU) memory
  {
    h_Filter = (dataType *)malloc(FILTER_LENGTH * sizeof(dataType));
    if (h_Filter == NULL)
    {
      printf("Error allocating memory on host for h_Filter");
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    h_Input = (dataType *)calloc(newImageSize, sizeof(dataType));
    if (h_Input == NULL)
    {
      printf("Error allocating memory on host for h_Input");
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    h_Buffer = (dataType *)calloc(newImageSize, sizeof(dataType));
    if (h_Buffer == NULL)
    {
      printf("Error allocating memory on host for h_Buffer");
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    h_OutputCPU = (dataType *)calloc(newImageSize, sizeof(dataType));
    if (h_OutputCPU == NULL)
    {
      printf("Error allocating memory on host for h_OutputCPU");
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    h_OutputGPU = (dataType *)calloc(newImageSize, sizeof(dataType));
    if (h_OutputGPU == NULL)
    {
      printf("Error allocating memory on host for h_OutputGPU");
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }

    // to 'h_Filter' apotelei to filtro me to opoio ginetai to convolution kai
    // arxikopoieitai tuxaia. To 'h_Input' einai h eikona panw sthn opoia ginetai
    // to convolution kai arxikopoieitai kai auth tuxaia.
  }

  printf("Allocate device (GPU) memory\n");
  //Allocate device (GPU) memory
  {
    err = cudaMalloc((void **)&d_Input, newImageSize * sizeof(dataType));
    if (err != cudaSuccess)
    {
      printf("Error allocating memory on host for d_Input:   %s\n", cudaGetErrorString(err));
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    cudaCalloc((void **)&d_Buffer, newImageSize, sizeof(dataType));

    cudaCalloc((void **)&d_OutputGPU, newImageSize, sizeof(dataType));
  }

  if (imageW < 32)
  {
    block_size = imageW;
    numberOfBlocks = 1;
  }
  else
  {
    block_size = 32;
    numberOfBlocks = imageW / block_size;
  }

  dim3 threadsPerBlock(block_size, block_size);   //geometry for block
  dim3 numBlocks(numberOfBlocks, numberOfBlocks); //geometry for grid
  int SH_MEM_SIZE_PAD = 32 + 2 * filter_radius;

  //Initializations
  {
    srand(200);
    // Random initialization of h_Filter
    for (i = 0; i < FILTER_LENGTH; i++)
    {
      h_Filter[i] = (dataType)(rand() % 16);
    }

    // Random initialization of h_Input
    for (i = filter_radius; i < (imageH + filter_radius); i++)
    {
      for (j = filter_radius; j < (imageW + filter_radius); j++)
      {
        h_Input[i * imageWithPaddingW + j] = (dataType)rand() / ((dataType)RAND_MAX / 255) + (dataType)rand() / (dataType)RAND_MAX;
      }
    }
  }

  //CPU Computation
  {
    // To parakatw einai to kommati pou ekteleitai sthn CPU kai me vash auto prepei na ginei h sugrish me thn GPU.
    printf("CPU computation is about to start...\n");
    //Get the starting time
    clock_gettime(CLOCK_MONOTONIC_RAW, &tv1);
    convolutionRowCPU(h_Buffer, h_Input, h_Filter, imageW, imageH, filter_radius);        // convolution kata grammes
    convolutionColumnCPU(h_OutputCPU, h_Buffer, h_Filter, imageW, imageH, filter_radius); // convolution kata sthles
    //Take the end time
    clock_gettime(CLOCK_MONOTONIC_RAW, &tv2);

    printf("CPU computation finished...\n");
  }

  //Calculate the duration of the CPU computation and report it
  {
    printf("\033[1;33m");
    printf("CPU time = %10g seconds\n",
           (double)(tv2.tv_nsec - tv1.tv_nsec) / 1000000000.0 +
               (double)(tv2.tv_sec - tv1.tv_sec));
  }
  printf("\033[0m");

  //Copy from host to device
  {
    cudaEventCreate(&start);
    cudaEventCreate(&stop);
    printf("Copy host memory to device\n");

    cudaEventRecord(start, 0);
    //Copy host memory to device
    err = cudaMemcpyToSymbol(d_Filter, h_Filter, FILTER_LENGTH * sizeof(dataType));
    if (err != cudaSuccess)
    {
      printf("Error during cudaMemcpyToSymbol of h_Filter to d_Filter:  %s\n", cudaGetErrorString(err));
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    err = cudaMemcpy(d_Input, h_Input, newImageSize * sizeof(dataType), cudaMemcpyHostToDevice);
    if (err != cudaSuccess)
    {
      printf("Error during cudaMemcpy of h_Input to d_Input:  %s\n", cudaGetErrorString(err));
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
  }

  //GPU Computation
  {
    printf("GPU computation is about to start...\n");

    //kernel for row convolution
    //execute grid of numBlocks blocks of threadsPerBlock threads each
    convolutionRowSharedMem<<<numBlocks, threadsPerBlock, (32 *( 32 + 2 * filter_radius)) * sizeof(dataType)>>>(d_Input, d_Buffer, filter_radius, imageW, SH_MEM_SIZE_PAD);

    err = cudaDeviceSynchronize();
    if (err != cudaSuccess)
    {
      printf("Error during cudaDeviceSynchronize:  %s\n", cudaGetErrorString(err));
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }

    //Error Checking
    cudaErrorCheck();

    //kernel for column convolution
    //execute grid of numBlocks blocks of threadsPerBlock threads each
    convolutionColumnSharedMem<<<numBlocks, threadsPerBlock, (32 * (32 + 2 * filter_radius)) * sizeof(dataType)>>>(d_Buffer, d_OutputGPU, filter_radius, imageW, imageH, SH_MEM_SIZE_PAD);

    err = cudaMemcpy(h_OutputGPU, d_OutputGPU, newImageSize * sizeof(dataType), cudaMemcpyDeviceToHost);
    if (err != cudaSuccess)
    {
      printf("Error during cudaMemcpy of d_OutputGPU to h_OutputGPU:  %s\n", cudaGetErrorString(err));
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }

    //Error Checking
    cudaErrorCheck();
    cudaEventRecord(stop, 0);
    printf("GPU computation finished...\n");
  }

  //Execution Time of GPU
  {
    cudaEventSynchronize(stop);
    cudaEventElapsedTime(&elapsed, start, stop);
    printf("\033[1;35m");
    printf("GPU time = %g ms\n", elapsed);
    printf("\033[0m");
    cudaEventDestroy(start);
    cudaEventDestroy(stop);
  }

  //Compare the results from CPU and GPU
  {
    for (i = filter_radius; i < imageH + filter_radius; i++)
    {
      for (j = filter_radius; j < imageW + filter_radius; j++)
      {
        diff = ABS(h_OutputCPU[i * imageWithPaddingW + j] - h_OutputGPU[i * imageWithPaddingW + j]);
        //printf("The difference between h_OutputCPU[%d]=%lf and h_OutputGPU[%d]=%lf is diff = %g\n", i * imageWithPaddingW + j, h_OutputCPU[i * imageWithPaddingW + j], i * imageWithPaddingW + j, h_OutputGPU[i * imageWithPaddingW + j], diff);
        if (diff > max_diff)
        {
          max_diff = diff;
        }
        if (diff > accuracy)
        {
          //printf("\t|->ERROR: The difference between the values of h_OutputCPU and h_OutputGPU at index i = %u is bigger than the given accuracy.\n", i);
        }
      }
    }

    if (max_diff > accuracy)
    {
      printf("\033[1;31m");
      printf("ERROR! Max difference between the values of h_OutputCPU and h_OutputGPU is max_diff = %g\n", max_diff);
    }
    else
    {
      printf("\033[1;32m");
      printf("Max difference between the values of h_OutputCPU and h_OutputGPU is max_diff = %g\n", max_diff);
    }
  }

  //Free allocated host and device memory
  printf("\033[0m");
  freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);

  return 0;
}

	.file	"tmpxft_003a7bc9_00000000-6_Convolution2D_tiled_with_padding_doubles.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2033:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2033:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z17convolutionRowCPUPdS_S_iii
	.type	_Z17convolutionRowCPUPdS_S_iii, @function
_Z17convolutionRowCPUPdS_S_iii:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	(%rcx,%r9,2), %r11d
	movl	%r9d, %r10d
	addl	%r9d, %r8d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%r11d, %eax
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	subl	%r9d, %eax
	movl	%r9d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	negl	%r13d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rsi, %rbp
	movslq	%r9d, %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	movl	%r9d, %edi
	leaq	(%rdx,%rsi,8), %r12
	imull	%r11d, %edi
	movl	%eax, -4(%rsp)
.L3:
	cmpl	%r10d, %r8d
	jle	.L2
	movslq	%edi, %rax
	movq	%rsi, %rcx
	addq	%rsi, %rax
	salq	$3, %rax
.L8:
	cmpl	%ecx, -4(%rsp)
	jle	.L11
	movslq	%r13d, %rdx
	xorps	%xmm0, %xmm0
	leaq	0(%rbp,%rax), %r14
.L4:
	cmpl	%edx, %r9d
	jl	.L12
	imulq	$-8, %rdx, %r15
	movsd	(%r14,%rdx,8), %xmm1
	incq	%rdx
	mulsd	(%r12,%r15), %xmm1
	addsd	%xmm1, %xmm0
	jmp	.L4
.L12:
	movsd	%xmm0, (%rbx,%rax)
	incq	%rcx
	addq	$8, %rax
	jmp	.L8
.L11:
	incl	%r10d
	addl	%r11d, %edi
	jmp	.L3
.L2:
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z17convolutionRowCPUPdS_S_iii, .-_Z17convolutionRowCPUPdS_S_iii
	.globl	_Z20convolutionColumnCPUPdS_S_iii
	.type	_Z20convolutionColumnCPUPdS_S_iii, @function
_Z20convolutionColumnCPUPdS_S_iii:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdx, %rax
	leal	(%rcx,%r9,2), %edx
	movl	%r9d, %r11d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r10d, %r10d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%edx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%r9d, %ebx
	leaq	0(,%rbp,8), %r13
	imull	%edx, %ebx
	movl	%ebx, -16(%rsp)
	movslq	%r9d, %rbx
	leaq	(%rax,%rbx,8), %r14
	leal	(%r9,%r8), %eax
	movl	%eax, -12(%rsp)
	movl	%edx, %eax
	subl	%r9d, %eax
	movl	%eax, -8(%rsp)
	movl	%r9d, %eax
	negl	%eax
	movl	%eax, -4(%rsp)
.L14:
	cmpl	%r11d, -12(%rsp)
	jle	.L13
	leaq	(%rsi,%r10,8), %rax
	movq	%rax, -24(%rsp)
	movslq	-16(%rsp), %rax
	leaq	(%rdi,%rax,8), %r12
	movq	%rbx, %rax
.L19:
	cmpl	%eax, -8(%rsp)
	jle	.L21
	movq	-24(%rsp), %r15
	movslq	-4(%rsp), %rcx
	xorps	%xmm0, %xmm0
	leaq	(%r15,%rax,8), %r8
.L15:
	cmpl	%ecx, %r9d
	jl	.L22
	imulq	$-8, %rcx, %r15
	incq	%rcx
	movsd	(%r14,%r15), %xmm1
	mulsd	(%r8), %xmm1
	addq	%r13, %r8
	addsd	%xmm1, %xmm0
	jmp	.L15
.L22:
	movsd	%xmm0, (%r12,%rax,8)
	incq	%rax
	jmp	.L19
.L21:
	addl	%edx, -16(%rsp)
	incl	%r11d
	addq	%rbp, %r10
	jmp	.L14
.L13:
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z20convolutionColumnCPUPdS_S_iii, .-_Z20convolutionColumnCPUPdS_S_iii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"Free host memory...\n"
.LC2:
	.string	"Free device memory...\n"
.LC3:
	.string	"Error during cudaFree (d_OutputGPU):  %s\n"
.LC4:
	.string	"Error during cudaFree (d_Buffer):  %s\n"
.LC5:
	.string	"Error during cudaFree (d_Input):  %s\n"
.LC6:
	.string	"Reset Device\n"
.LC7:
	.string	"Error during cudaDeviceReset:  %s\n"
	.text
	.globl	_Z10freeMemoryPdS_S_S_S_S_S_S_
	.type	_Z10freeMemoryPdS_S_S_S_S_S_S_, @function
_Z10freeMemoryPdS_S_S_S_S_S_S_:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%r8, %r15
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rcx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	leaq	.LC1(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	movl	$2, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r9, %rbx
	pushq	%r10
	.cfi_def_cfa_offset 64
	call	__printf_chk@PLT
	testq	%r15, %r15
	je	.L24
	movq	%r15, %rdi
	call	free@PLT
.L24:
	testq	%r14, %r14
	je	.L25
	movq	%r14, %rdi
	call	free@PLT
.L25:
	testq	%r13, %r13
	je	.L26
	movq	%r13, %rdi
	call	free@PLT
.L26:
	testq	%r12, %r12
	je	.L27
	movq	%r12, %rdi
	call	free@PLT
.L27:
	testq	%rbp, %rbp
	je	.L28
	movq	%rbp, %rdi
	call	free@PLT
.L28:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	cmpq	$0, 72(%rsp)
	je	.L29
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L29
	call	cudaGetErrorString@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdx
	jmp	.L70
.L29:
	cmpq	$0, 64(%rsp)
	je	.L31
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L31
	call	cudaGetErrorString@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdx
.L70:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %eax
	jmp	.L23
.L31:
	testq	%rbx, %rbx
	je	.L33
	movq	%rbx, %rdi
	call	cudaFree@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L33
	call	cudaGetErrorString@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdx
	jmp	.L70
.L33:
	movl	$2, %edi
	leaq	.LC6(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	call	cudaDeviceReset@PLT
	movl	%eax, %edi
	xorl	%eax, %eax
	testl	%edi, %edi
	je	.L23
	call	cudaGetErrorString@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rax, %rdx
	jmp	.L70
.L23:
	popq	%rdx
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z10freeMemoryPdS_S_S_S_S_S_S_, .-_Z10freeMemoryPdS_S_S_S_S_S_S_
	.globl	_Z38__device_stub__Z14convolutionRowPdS_iiPdS_ii
	.type	_Z38__device_stub__Z14convolutionRowPdS_iiPdS_ii, @function
_Z38__device_stub__Z14convolutionRowPdS_iiPdS_ii:
.LFB2055:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L71
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z14convolutionRowPdS_ii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L71:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L73
	call	__stack_chk_fail@PLT
.L73:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2055:
	.size	_Z38__device_stub__Z14convolutionRowPdS_iiPdS_ii, .-_Z38__device_stub__Z14convolutionRowPdS_iiPdS_ii
	.globl	_Z14convolutionRowPdS_ii
	.type	_Z14convolutionRowPdS_ii, @function
_Z14convolutionRowPdS_ii:
.LFB2056:
	.cfi_startproc
	endbr64
	jmp	_Z38__device_stub__Z14convolutionRowPdS_iiPdS_ii
	.cfi_endproc
.LFE2056:
	.size	_Z14convolutionRowPdS_ii, .-_Z14convolutionRowPdS_ii
	.globl	_Z42__device_stub__Z17convolutionColumnPdS_iiiPdS_iii
	.type	_Z42__device_stub__Z17convolutionColumnPdS_iiiPdS_iii, @function
_Z42__device_stub__Z17convolutionColumnPdS_iiiPdS_iii:
.LFB2057:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L76
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z17convolutionColumnPdS_iii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L76:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L78
	call	__stack_chk_fail@PLT
.L78:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2057:
	.size	_Z42__device_stub__Z17convolutionColumnPdS_iiiPdS_iii, .-_Z42__device_stub__Z17convolutionColumnPdS_iiiPdS_iii
	.globl	_Z17convolutionColumnPdS_iii
	.type	_Z17convolutionColumnPdS_iii, @function
_Z17convolutionColumnPdS_iii:
.LFB2058:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z17convolutionColumnPdS_iiiPdS_iii
	.cfi_endproc
.LFE2058:
	.size	_Z17convolutionColumnPdS_iii, .-_Z17convolutionColumnPdS_iii
	.globl	_Z48__device_stub__Z23convolutionRowSharedMemPdS_iiiPdS_iii
	.type	_Z48__device_stub__Z23convolutionRowSharedMemPdS_iiiPdS_iii, @function
_Z48__device_stub__Z23convolutionRowSharedMemPdS_iiiPdS_iii:
.LFB2059:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L81
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z23convolutionRowSharedMemPdS_iii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L81:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L83
	call	__stack_chk_fail@PLT
.L83:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2059:
	.size	_Z48__device_stub__Z23convolutionRowSharedMemPdS_iiiPdS_iii, .-_Z48__device_stub__Z23convolutionRowSharedMemPdS_iiiPdS_iii
	.globl	_Z23convolutionRowSharedMemPdS_iii
	.type	_Z23convolutionRowSharedMemPdS_iii, @function
_Z23convolutionRowSharedMemPdS_iii:
.LFB2060:
	.cfi_startproc
	endbr64
	jmp	_Z48__device_stub__Z23convolutionRowSharedMemPdS_iiiPdS_iii
	.cfi_endproc
.LFE2060:
	.size	_Z23convolutionRowSharedMemPdS_iii, .-_Z23convolutionRowSharedMemPdS_iii
	.globl	_Z52__device_stub__Z26convolutionColumnSharedMemPdS_iiiiPdS_iiii
	.type	_Z52__device_stub__Z26convolutionColumnSharedMemPdS_iiiiPdS_iiii, @function
_Z52__device_stub__Z26convolutionColumnSharedMemPdS_iiiiPdS_iiii:
.LFB2061:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movl	%r8d, 4(%rsp)
	movl	%r9d, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 136(%rsp)
	movq	%rsp, %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L86
	pushq	48(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z26convolutionColumnSharedMemPdS_iiii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 192
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L86:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L88
	call	__stack_chk_fail@PLT
.L88:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2061:
	.size	_Z52__device_stub__Z26convolutionColumnSharedMemPdS_iiiiPdS_iiii, .-_Z52__device_stub__Z26convolutionColumnSharedMemPdS_iiiiPdS_iiii
	.globl	_Z26convolutionColumnSharedMemPdS_iiii
	.type	_Z26convolutionColumnSharedMemPdS_iiii, @function
_Z26convolutionColumnSharedMemPdS_iiii:
.LFB2062:
	.cfi_startproc
	endbr64
	jmp	_Z52__device_stub__Z26convolutionColumnSharedMemPdS_iiiiPdS_iiii
	.cfi_endproc
.LFE2062:
	.size	_Z26convolutionColumnSharedMemPdS_iiii, .-_Z26convolutionColumnSharedMemPdS_iiii
	.section	.rodata.str1.1
.LC8:
	.string	"Enter filter radius : "
.LC9:
	.string	"%d"
.LC10:
	.string	"Enter image size. Should be a power of two and greater than %d : "
.LC11:
	.string	"Image Width x Height = %i x %i\n\n"
.LC12:
	.string	"Allocating and initializing host arrays...\n"
.LC13:
	.string	"Error allocating memory on host for h_Filter"
.LC14:
	.string	"Error allocating memory on host for h_Input"
.LC15:
	.string	"Error allocating memory on host for h_Buffer"
.LC16:
	.string	"Error allocating memory on host for h_OutputCPU"
.LC17:
	.string	"Error allocating memory on host for h_OutputGPU"
.LC18:
	.string	"Allocate device (GPU) memory\n"
.LC19:
	.string	"Error allocating memory on host for d_Input:   %s\n"
.LC20:
	.string	"Error allocating memory on host:   %s\n"
.LC23:
	.string	"CPU computation is about to start...\n"
.LC24:
	.string	"CPU computation finished...\n"
.LC25:
	.string	"\033[1;33m"
.LC27:
	.string	"CPU time = %10g seconds\n"
.LC28:
	.string	"\033[0m"
.LC29:
	.string	"Copy host memory to device\n"
.LC30:
	.string	"Error during cudaMemcpyToSymbol of h_Filter to d_Filter:  %s\n"
.LC31:
	.string	"Error during cudaMemcpy of h_Input to d_Input:  %s\n"
.LC32:
	.string	"GPU computation is about to start...\n"
.LC33:
	.string	"Error during cudaDeviceSynchronize:  %s\n"
.LC34:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/ChrisGeorgakidis/High-Performance-Computing/master/Lab_4/Convolution2D_tiled_with_padding_doubles.cu"
.LC35:
	.string	"Cuda Error Found %s:%d:  '%s'\n"
.LC36:
	.string	"Error during cudaMemcpy of d_OutputGPU to h_OutputGPU:  %s\n"
.LC37:
	.string	"GPU computation finished...\n"
.LC38:
	.string	"\033[1;35m"
.LC39:
	.string	"GPU time = %g ms\n"
.LC42:
	.string	"\033[1;31m"
.LC43:
	.string	"ERROR! Max difference between the values of h_OutputCPU and h_OutputGPU is max_diff = %g\n"
.LC44:
	.string	"\033[1;32m"
.LC45:
	.string	"Max difference between the values of h_OutputCPU and h_OutputGPU is max_diff = %g\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%edi, %edi
	leaq	.LC8(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC9(%rip), %rbx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	movq	%rdi, 56(%rsp)
	movq	%rdi, 64(%rsp)
	movq	%rdi, 72(%rsp)
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%rbx, %rdi
	leaq	filter_radius(%rip), %rsi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movl	filter_radius(%rip), %eax
	movl	$2, %edi
	leaq	.LC10(%rip), %rsi
	leal	1(%rax,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rdi
	leaq	48(%rsp), %rsi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movl	48(%rsp), %r12d
	movl	filter_radius(%rip), %eax
	leaq	.LC11(%rip), %rbx
	movq	%rbx, %rsi
	movl	$2, %edi
	leal	(%r12,%rax,2), %r13d
	movl	%r12d, %ecx
	movl	%r12d, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r13d, %ecx
	movl	%r13d, %edx
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	movl	%r13d, %r14d
	call	__printf_chk@PLT
	movl	$2, %edi
	imull	%r13d, %r14d
	xorl	%eax, %eax
	leaq	.LC12(%rip), %rsi
	call	__printf_chk@PLT
	movl	filter_radius(%rip), %eax
	leal	1(%rax,%rax), %edi
	salq	$3, %rdi
	call	malloc@PLT
	movq	%rax, (%rsp)
	testq	%rax, %rax
	jne	.L92
	leaq	.LC13(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	pushq	72(%rsp)
	.cfi_remember_state
	.cfi_def_cfa_offset 232
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	xorl	%edx, %edx
	xorl	%esi, %esi
	xorl	%edi, %edi
	movq	72(%rsp), %r9
	jmp	.L133
.L92:
	.cfi_restore_state
	movslq	%r14d, %r14
	movl	$8, %esi
	movq	%r14, %rdi
	call	calloc@PLT
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	jne	.L94
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	pushq	72(%rsp)
	.cfi_def_cfa_offset 232
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	xorl	%edx, %edx
	xorl	%esi, %esi
	movq	72(%rsp), %r9
.L134:
	movq	16(%rsp), %rdi
.L133:
	call	_Z10freeMemoryPdS_S_S_S_S_S_S_
	popq	%rcx
	.cfi_def_cfa_offset 232
	orl	$-1, %eax
	popq	%rsi
	.cfi_def_cfa_offset 224
	jmp	.L91
.L94:
	movl	$8, %esi
	movq	%r14, %rdi
	call	calloc@PLT
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L96
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	pushq	72(%rsp)
	.cfi_remember_state
	.cfi_def_cfa_offset 232
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	xorl	%edx, %edx
	movq	72(%rsp), %r9
	jmp	.L136
.L96:
	.cfi_restore_state
	movl	$8, %esi
	movq	%r14, %rdi
	call	calloc@PLT
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	.L97
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	pushq	72(%rsp)
	.cfi_remember_state
	.cfi_def_cfa_offset 232
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	movq	72(%rsp), %r9
	jmp	.L140
.L97:
	.cfi_restore_state
	movl	$8, %esi
	movq	%r14, %rdi
	call	calloc@PLT
	movq	%rax, %rbp
	testq	%rax, %rax
	jne	.L98
	leaq	.LC17(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	pushq	72(%rsp)
	.cfi_remember_state
	.cfi_def_cfa_offset 232
	xorl	%r8d, %r8d
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	movq	72(%rsp), %r9
	jmp	.L139
.L98:
	.cfi_restore_state
	leaq	.LC18(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	0(,%r14,8), %rax
	leaq	56(%rsp), %rdi
	movq	%rax, %rsi
	movq	%rax, 24(%rsp)
	call	cudaMalloc@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L99
	call	cudaGetErrorString@PLT
	leaq	.LC19(%rip), %rsi
	movq	%rax, %rdx
	jmp	.L141
.L99:
	movq	24(%rsp), %rsi
	leaq	64(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L142
	movq	24(%rsp), %rdx
	movq	64(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaMemset@PLT
	movq	24(%rsp), %rsi
	leaq	72(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %r14d
	testl	%eax, %eax
	je	.L101
	movl	%eax, %edi
.L142:
	call	cudaGetErrorString@PLT
	leaq	.LC20(%rip), %rsi
	movq	%rax, %rdx
	jmp	.L141
.L101:
	movq	24(%rsp), %rdx
	movq	72(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaMemset@PLT
	movl	48(%rsp), %eax
	cmpl	$31, %eax
	jg	.L102
	movl	%eax, %edx
	movl	$1, %eax
	jmp	.L103
.L102:
	shrl	$5, %eax
	movl	$32, %edx
.L103:
	movl	%eax, 108(%rsp)
	movl	$200, %edi
	movl	$16, %r15d
	movl	%eax, 112(%rsp)
	movl	filter_radius(%rip), %eax
	movl	%edx, 96(%rsp)
	leal	32(%rax,%rax), %eax
	movl	%edx, 100(%rsp)
	movl	$1, 104(%rsp)
	movl	$1, 116(%rsp)
	movl	%eax, 40(%rsp)
	call	srand@PLT
.L104:
	movl	filter_radius(%rip), %edx
	leal	1(%rdx,%rdx), %eax
	cmpl	%eax, %r14d
	jnb	.L143
	call	rand@PLT
	movl	%r14d, %ecx
	incl	%r14d
	cltd
	idivl	%r15d
	movq	(%rsp), %rax
	cvtsi2sdl	%edx, %xmm0
	movsd	%xmm0, (%rax,%rcx,8)
	jmp	.L104
.L143:
	movl	%r13d, %r15d
	imull	%edx, %r15d
.L106:
	movl	filter_radius(%rip), %r14d
	leal	(%r12,%r14), %eax
	cmpl	%eax, %edx
	jnb	.L144
.L108:
	movl	filter_radius(%rip), %eax
	addl	48(%rsp), %eax
	cmpl	%eax, %r14d
	jnb	.L145
	movl	%edx, 44(%rsp)
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC21(%rip), %xmm0
	movsd	%xmm0, 32(%rsp)
	call	rand@PLT
	movl	44(%rsp), %edx
	movl	%eax, %ecx
	leal	(%r15,%r14), %eax
	incl	%r14d
	cvtsi2sdl	%ecx, %xmm0
	divsd	.LC22(%rip), %xmm0
	addsd	32(%rsp), %xmm0
	movq	8(%rsp), %rcx
	movsd	%xmm0, (%rcx,%rax,8)
	jmp	.L108
.L145:
	incl	%edx
	addl	%r13d, %r15d
	jmp	.L106
.L144:
	leaq	.LC23(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	120(%rsp), %rsi
	movl	$4, %edi
	call	clock_gettime@PLT
	movl	48(%rsp), %r14d
	movq	(%rsp), %rdx
	movl	%r12d, %r8d
	movl	filter_radius(%rip), %r9d
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	%r14d, %ecx
	call	_Z17convolutionRowCPUPdS_S_iii
	movq	(%rsp), %rdx
	movl	%r12d, %r8d
	movl	%r14d, %ecx
	movq	16(%rsp), %rsi
	movq	%rbx, %rdi
	call	_Z20convolutionColumnCPUPdS_S_iii
	leaq	136(%rsp), %rsi
	movl	$4, %edi
	call	clock_gettime@PLT
	leaq	.LC24(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC25(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	144(%rsp), %rax
	movl	$2, %edi
	subq	128(%rsp), %rax
	cvtsi2sdq	%rax, %xmm0
	movq	136(%rsp), %rax
	subq	120(%rsp), %rax
	divsd	.LC26(%rip), %xmm0
	cvtsi2sdq	%rax, %xmm1
	leaq	.LC27(%rip), %rsi
	movb	$1, %al
	addsd	%xmm1, %xmm0
	call	__printf_chk@PLT
	leaq	.LC28(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	80(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	88(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	.LC29(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	80(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	filter_radius(%rip), %eax
	movq	(%rsp), %rsi
	xorl	%ecx, %ecx
	leaq	_ZL8d_Filter(%rip), %rdi
	movl	$1, %r8d
	leal	1(%rax,%rax), %edx
	salq	$3, %rdx
	call	cudaMemcpyToSymbol@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L109
	call	cudaGetErrorString@PLT
	leaq	.LC30(%rip), %rsi
	movq	%rax, %rdx
	jmp	.L141
.L109:
	movq	56(%rsp), %rdi
	movq	24(%rsp), %rdx
	movl	$1, %ecx
	movq	8(%rsp), %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L110
	call	cudaGetErrorString@PLT
	leaq	.LC31(%rip), %rsi
	movq	%rax, %rdx
	jmp	.L141
.L110:
	leaq	.LC32(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	104(%rsp), %ecx
	movl	116(%rsp), %esi
	xorl	%r9d, %r9d
	movl	filter_radius(%rip), %eax
	movq	96(%rsp), %rdx
	movq	108(%rsp), %rdi
	addl	$16, %eax
	sall	$6, %eax
	leaq	0(,%rax,8), %r8
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L111
	movl	40(%rsp), %r8d
	movl	48(%rsp), %ecx
	movl	filter_radius(%rip), %edx
	movq	64(%rsp), %rsi
	movq	56(%rsp), %rdi
	call	_Z48__device_stub__Z23convolutionRowSharedMemPdS_iiiPdS_iii
.L111:
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L112
	call	cudaGetErrorString@PLT
	leaq	.LC33(%rip), %rsi
	movq	%rax, %rdx
	jmp	.L141
.L112:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L113
	call	cudaGetErrorString@PLT
	movl	$504, %ecx
	movq	%rax, %r8
	jmp	.L138
.L113:
	movl	filter_radius(%rip), %eax
	movl	104(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	96(%rsp), %rdx
	movq	108(%rsp), %rdi
	addl	$16, %eax
	movl	116(%rsp), %esi
	sall	$6, %eax
	leaq	0(,%rax,8), %r8
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L114
	movl	40(%rsp), %r9d
	movl	48(%rsp), %ecx
	movl	%r12d, %r8d
	movl	filter_radius(%rip), %edx
	movq	72(%rsp), %rsi
	movq	64(%rsp), %rdi
	call	_Z52__device_stub__Z26convolutionColumnSharedMemPdS_iiiiPdS_iiii
.L114:
	movq	24(%rsp), %rdx
	movq	72(%rsp), %rsi
	movq	%rbp, %rdi
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L115
	call	cudaGetErrorString@PLT
	leaq	.LC36(%rip), %rsi
	movq	%rax, %rdx
.L141:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L137
.L115:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L116
	call	cudaGetErrorString@PLT
	movl	$519, %ecx
	movq	%rax, %r8
.L138:
	leaq	.LC34(%rip), %rdx
	leaq	.LC35(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L137:
	pushq	72(%rsp)
	.cfi_def_cfa_offset 232
	movq	%rbp, %r8
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	movq	72(%rsp), %r9
.L139:
	movq	%rbx, %rcx
.L140:
	movq	32(%rsp), %rdx
.L136:
	movq	24(%rsp), %rsi
	jmp	.L134
.L116:
	.cfi_def_cfa_offset 224
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	leaq	.LC28(%rip), %r14
	call	cudaEventRecord@PLT
	leaq	.LC37(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	88(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	88(%rsp), %rdx
	movq	80(%rsp), %rsi
	leaq	52(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
	leaq	.LC38(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC39(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	52(%rsp), %xmm0
	call	__printf_chk@PLT
	movq	%r14, %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	80(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movq	88(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movl	%r13d, %esi
	movl	48(%rsp), %r8d
	xorps	%xmm0, %xmm0
	movl	filter_radius(%rip), %eax
	movq	.LC40(%rip), %xmm3
	movaps	%xmm0, %xmm2
	imull	%eax, %esi
	addl	%eax, %r8d
	movl	%eax, %ecx
	addl	%eax, %r12d
.L117:
	cmpl	%r12d, %ecx
	jnb	.L146
	movl	%eax, %edx
.L122:
	cmpl	%r8d, %edx
	jnb	.L147
	leal	(%rdx,%rsi), %edi
	movsd	(%rbx,%rdi,8), %xmm1
	subsd	0(%rbp,%rdi,8), %xmm1
	comisd	%xmm1, %xmm2
	jbe	.L118
	xorps	%xmm3, %xmm1
.L118:
	maxsd	%xmm0, %xmm1
	incl	%edx
	movaps	%xmm1, %xmm0
	jmp	.L122
.L147:
	incl	%ecx
	addl	%r13d, %esi
	jmp	.L117
.L146:
	comisd	.LC41(%rip), %xmm0
	movsd	%xmm0, 24(%rsp)
	jbe	.L131
	leaq	.LC42(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movsd	24(%rsp), %xmm0
	leaq	.LC43(%rip), %rsi
	jmp	.L135
.L131:
	leaq	.LC44(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movsd	24(%rsp), %xmm0
	leaq	.LC45(%rip), %rsi
.L135:
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
	movq	%r14, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	pushq	72(%rsp)
	.cfi_def_cfa_offset 232
	movq	%rbp, %r8
	movq	%rbx, %rcx
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	movq	72(%rsp), %r9
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	call	_Z10freeMemoryPdS_S_S_S_S_S_S_
	popq	%rax
	.cfi_def_cfa_offset 232
	xorl	%eax, %eax
	popq	%rdx
	.cfi_def_cfa_offset 224
.L91:
	movq	152(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L126
	call	__stack_chk_fail@PLT
.L126:
	addq	$168, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	main, .-main
	.section	.rodata.str1.1
.LC46:
	.string	"_Z26convolutionColumnSharedMemPdS_iiii"
.LC47:
	.string	"_Z23convolutionRowSharedMemPdS_iii"
.LC48:
	.string	"_Z17convolutionColumnPdS_iii"
.LC49:
	.string	"_Z14convolutionRowPdS_ii"
.LC50:
	.string	"d_Filter"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2064:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC46(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z26convolutionColumnSharedMemPdS_iiii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC47(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z23convolutionRowSharedMemPdS_iii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC48(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17convolutionColumnPdS_iii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC49(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z14convolutionRowPdS_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC50(%rip), %rdx
	movl	$65536, %r9d
	leaq	_ZL8d_Filter(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2064:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.local	_ZL8d_Filter
	.comm	_ZL8d_Filter,65536,32
	.globl	filter_radius
	.bss
	.align 4
	.type	filter_radius, @object
	.size	filter_radius, 4
filter_radius:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC21:
	.long	267382768
	.long	1096814608
	.align 8
.LC22:
	.long	-4194304
	.long	1105199103
	.align 8
.LC26:
	.long	0
	.long	1104006501
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC40:
	.long	0
	.long	-2147483648
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC41:
	.long	-350469331
	.long	1057634018
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

/*
* This sample implements a separable convolution
* of a 2D image with an arbitrary filter.
*/


#include <hip/hip_runtime.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

unsigned int filter_radius;

#define FILTER_LENGTH (2 * filter_radius + 1)
#define ABS(val) ((val) < 0.0 ? (-(val)) : (val))
#define accuracy 0.00005
#define ArraySize imageW *imageH
#define ERROR -1
#define FILTER_R_X2 2*filter_radius
#define SH_MEM_SIZE 32
#define NUMBLOCKS 4

typedef double dataType;
__constant__ dataType d_Filter[65536/sizeof(dataType)];

// This checks for cuda errors
#define cudaErrorCheck()                                                                                 \
  {                                                                                                      \
    hipError_t error = hipGetLastError();                                                              \
    if (error != hipSuccess)                                                                            \
    {                                                                                                    \
      printf("Cuda Error Found %s:%d:  '%s'\n", __FILE__, __LINE__, hipGetErrorString(error));          \
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU); \
      return (ERROR);                                                                                    \
    }                                                                                                    \
  }

#define cudaCalloc(pointer, size, sizeOfElement)                                                         \
  {                                                                                                      \
    hipError_t err = hipMalloc(pointer, size * sizeOfElement);                                         \
    if (err != hipSuccess)                                                                              \
    {                                                                                                    \
      printf("Error allocating memory on host:   %s\n", hipGetErrorString(err));                        \
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU); \
      return (ERROR);                                                                                    \
    }                                                                                                    \
    hipMemset(*pointer, 0.0, size *sizeOfElement);                                                      \
  }

////////////////////////////////////////////////////////////////////////////////
// Kernel Row Convolution Filter
////////////////////////////////////////////////////////////////////////////////
__global__ void convolutionRow(dataType *Input, dataType *Output, int filterR, int imageW)
{
  dataType sum = 0;
  int d, k;

  int ix = blockIdx.x * blockDim.x + threadIdx.x + filterR;
  int iy = blockIdx.y * blockDim.y + threadIdx.y + filterR;
  //int dimx = blockDim.x * gridDim.x + 2 * filterR;
  //int idx = iy * dimx + ix;
  int imageWithPaddingW = imageW + 2 * filterR;

  for (k = -filterR; k <= filterR; k++)
  {
    d = ix + k;
    sum += Input[iy * imageWithPaddingW + d] * d_Filter[filterR - k];
  }
  Output[iy * imageWithPaddingW + ix] = sum; //Only 1 time for each thread
}


////////////////////////////////////////////////////////////////////////////////
// Kernel Column Convolution Filter
////////////////////////////////////////////////////////////////////////////////
__global__ void convolutionColumn(dataType *Input, dataType *Output, int filterR, int imageW, int imageH)
{
  dataType sum = 0;
  int d, k;

  int ix = blockIdx.x * blockDim.x + threadIdx.x + filterR;
  int iy = blockIdx.y * blockDim.y + threadIdx.y + filterR;

  int imageWithPaddingW = imageW + 2 * filterR;

  for (k = -filterR; k <= filterR; k++)
  {
    d = iy + k;

    sum += Input[d * imageWithPaddingW + ix] * d_Filter[filterR - k];

    Output[iy * imageWithPaddingW + ix] = sum;
  }
}


////////////////////////////////////////////////////////////////////////////////
// Kernel Row Convolution Filter using Shared Memory
////////////////////////////////////////////////////////////////////////////////
__global__ void convolutionRowSharedMem(dataType *Input, dataType *Output, int filterR, int imageW, int SH_MEM_SIZE_PAD)
{
  dataType sum = 0;
  int d, k;

  int tx = threadIdx.x + filterR;
  int ix = blockIdx.x * blockDim.x + threadIdx.x + filterR;
  int iy = blockIdx.y * blockDim.y + threadIdx.y + filterR;

  //indexes in arrays including padding
  int ptx = threadIdx.x;
  int pty = threadIdx.y;
  int pix = blockIdx.x * blockDim.x + threadIdx.x;

  int imageWithPaddingW = imageW + 2 * filterR;

  //shared memory for Input
  extern __shared__ dataType s_Input[]; // shared memory with padding

  //collaboratively load tiles into __shared__
  for (int i = 0; i < SH_MEM_SIZE_PAD/32; i++){
    s_Input[pty * SH_MEM_SIZE_PAD + (SH_MEM_SIZE_PAD / 32) * ptx + i] = Input[iy * imageWithPaddingW + (SH_MEM_SIZE_PAD / 32) * pix + i - ((SH_MEM_SIZE_PAD / 32) - 1) * (blockIdx.x * blockDim.x)];
  }

  __syncthreads();

  for (k = -filterR; k <= filterR; k++)
  {
    d = tx + k;
    sum += s_Input[pty * SH_MEM_SIZE_PAD + d] * d_Filter[filterR - k];
  }
  Output[iy * imageWithPaddingW + ix] = sum; //1 time for each thread
}


////////////////////////////////////////////////////////////////////////////////
// Kernel Column Convolution Filter using Shared Memory
////////////////////////////////////////////////////////////////////////////////
__global__ void convolutionColumnSharedMem(dataType *Input, dataType *Output, int filterR, int imageW, int imageH, int SH_MEM_SIZE_PAD)
{
  dataType sum = 0;
  int d, k;

  int ty = threadIdx.y + filterR;
  int ix = blockIdx.x * blockDim.x + threadIdx.x + filterR;
  int iy = blockIdx.y * blockDim.y + threadIdx.y + filterR;

  //indexes in arrays including padding
  int ptx = threadIdx.x;
  int pty = threadIdx.y;
  int piy = blockIdx.y * blockDim.y + pty;

  int imageWithPaddingW = imageW + 2 * filterR;

  //shared memory for Input
  extern __shared__ dataType s_Input[];

  //collaboratively load tiles into __shared__
  for (int i = 0; i < SH_MEM_SIZE_PAD/32; i++){
    s_Input[(pty * (SH_MEM_SIZE_PAD / 32) + i) * SH_MEM_SIZE + ptx] = Input[(piy * (SH_MEM_SIZE_PAD / 32) + i - ((SH_MEM_SIZE_PAD / 32) - 1)*(blockIdx.y * blockDim.y)) * imageWithPaddingW + ix];
  }
  __syncthreads();

  for (k = -filterR; k <= filterR; k++)
  {
    d = ty + k;
    sum += s_Input[d * SH_MEM_SIZE + ptx] * d_Filter[filterR - k];
  }
  Output[iy * imageWithPaddingW + ix] = sum; //One time for each thread
}


////////////////////////////////////////////////////////////////////////////////
// Reference row convolution filter
////////////////////////////////////////////////////////////////////////////////
void convolutionRowCPU(dataType *h_Dst, dataType *h_Src, dataType *h_Filter,
int imageW, int imageH, int filterR)
{
  int x, y, k;
  int imageWithPaddingW = imageW + 2 * filterR;

  for (y = filterR; y < (imageH + filterR); y++)
  {
    for (x = filterR; x < (imageW + filterR); x++)
    {
      dataType sum = 0;

      for (k = -filterR; k <= filterR; k++)
      {
        int d = x + k;
        sum += h_Src[y * imageWithPaddingW + d] * h_Filter[filterR - k];
      }
      h_Dst[y * imageWithPaddingW + x] = sum; //One time for each x & y
    }
  }
}


////////////////////////////////////////////////////////////////////////////////
// Reference column convolution filter
////////////////////////////////////////////////////////////////////////////////
void convolutionColumnCPU(dataType *h_Dst, dataType *h_Src, dataType *h_Filter,
int imageW, int imageH, int filterR)
{
  int x, y, k;
  int imageWithPaddingW = imageW + 2 * filterR;

  for (y = filterR; y < (imageH + filterR); y++)
  {
    for (x = filterR; x < (imageW + filterR); x++)
    {
      dataType sum = 0;

      for (k = -filterR; k <= filterR; k++)
      {
        int d = y + k;
        sum += h_Src[d * imageWithPaddingW + x] * h_Filter[filterR - k];
      }
      h_Dst[y * imageWithPaddingW + x] = sum; //One time for each x & y
    }
  }
}

////////////////////////////////////////////////////////////////////////////////
// Free Alocated Host and Device Memory
////////////////////////////////////////////////////////////////////////////////
int freeMemory(dataType *h_Filter, dataType *h_Input, dataType *h_Buffer, dataType *h_OutputCPU, dataType *h_OutputGPU, dataType *d_Input, dataType *d_Buffer, dataType *d_OutputGPU)
{
  hipError_t err;

  // free all the allocated memory for the host
  printf("Free host memory...\n");
  if (h_OutputGPU != NULL)
  {
    free(h_OutputGPU);
  }
  if (h_OutputCPU != NULL)
  {
    free(h_OutputCPU);
  }
  if (h_Buffer != NULL)
  {
    free(h_Buffer);
  }
  if (h_Input != NULL)
  {
    free(h_Input);
  }
  if (h_Filter != NULL)
  {
    free(h_Filter);
  }

  //free all the allocated device (GPU) memory
  printf("Free device memory...\n");
  if (d_OutputGPU != NULL)
  {
    err = hipFree(d_OutputGPU);
    if (err != hipSuccess)
    {
      printf("Error during hipFree (d_OutputGPU):  %s\n", hipGetErrorString(err));
      return (ERROR);
    }
  }
  if (d_Buffer != NULL)
  {
    err = hipFree(d_Buffer);
    if (err != hipSuccess)
    {
      printf("Error during hipFree (d_Buffer):  %s\n", hipGetErrorString(err));
      return (ERROR);
    }
  }
  if (d_Input != NULL)
  {
    err = hipFree(d_Input);
    if (err != hipSuccess)
    {
      printf("Error during hipFree (d_Input):  %s\n", hipGetErrorString(err));
      return (ERROR);
    }
  }

  // Do a device reset just in case... Bgalte to sxolio otan ylopoihsete CUDA
  printf("Reset Device\n");
  err = hipDeviceReset();
  if (err != hipSuccess)
  {
    printf("Error during cudaDeviceReset:  %s\n", hipGetErrorString(err));
    return (ERROR);
  }

  return (0);
}

////////////////////////////////////////////////////////////////////////////////
// Main program
////////////////////////////////////////////////////////////////////////////////
int main(int argc, char **argv)
{

  //pointers for the host
  dataType
      *h_Filter = NULL,
      *h_Input = NULL,
      *h_Buffer = NULL,
      *h_OutputCPU = NULL,
      *h_OutputGPU = NULL;

  //pointers for the device
  dataType
      *d_Input = NULL,
      *d_Buffer = NULL,
      *d_OutputGPU = NULL;

  int imageW; //image width = N
  int imageH; //image height = N
  unsigned int i, j, block_size, numberOfBlocks;
  dataType diff = 0, max_diff = 0;

  /*-------timing variables-------*/
  struct timespec tv1, tv2;
  hipError_t err;
  hipEvent_t start;
  hipEvent_t stop;
  float elapsed;
  /*------------------------------*/

  /*------padding variables-------*/
  int imageWithPaddingW, newImageSize;
  /*------------------------------*/

  printf("Enter filter radius : ");
  scanf("%d", &filter_radius);

  // Ta imageW, imageH ta dinei o xrhsths kai thewroume oti einai isa,
  // dhladh imageW = imageH = N, opou to N to dinei o xrhsths.
  // Gia aplothta thewroume tetragwnikes eikones.

  printf("Enter image size. Should be a power of two and greater than %d : ", FILTER_LENGTH);
  scanf("%d", &imageW); //TODO Warning
  imageH = imageW;

  imageWithPaddingW = imageW + 2 * filter_radius;
  newImageSize = imageWithPaddingW * imageWithPaddingW;

  printf("Image Width x Height = %i x %i\n\n", imageW, imageH);
  printf("Image Width x Height = %i x %i\n\n", imageWithPaddingW, imageWithPaddingW);
  printf("Allocating and initializing host arrays...\n");

  //Allocate host (CPU) memory
  {
    h_Filter = (dataType *)malloc(FILTER_LENGTH * sizeof(dataType));
    if (h_Filter == NULL)
    {
      printf("Error allocating memory on host for h_Filter");
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    h_Input = (dataType *)calloc(newImageSize, sizeof(dataType));
    if (h_Input == NULL)
    {
      printf("Error allocating memory on host for h_Input");
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    h_Buffer = (dataType *)calloc(newImageSize, sizeof(dataType));
    if (h_Buffer == NULL)
    {
      printf("Error allocating memory on host for h_Buffer");
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    h_OutputCPU = (dataType *)calloc(newImageSize, sizeof(dataType));
    if (h_OutputCPU == NULL)
    {
      printf("Error allocating memory on host for h_OutputCPU");
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    h_OutputGPU = (dataType *)calloc(newImageSize, sizeof(dataType));
    if (h_OutputGPU == NULL)
    {
      printf("Error allocating memory on host for h_OutputGPU");
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }

    // to 'h_Filter' apotelei to filtro me to opoio ginetai to convolution kai
    // arxikopoieitai tuxaia. To 'h_Input' einai h eikona panw sthn opoia ginetai
    // to convolution kai arxikopoieitai kai auth tuxaia.
  }

  printf("Allocate device (GPU) memory\n");
  //Allocate device (GPU) memory
  {
    err = hipMalloc((void **)&d_Input, newImageSize * sizeof(dataType));
    if (err != hipSuccess)
    {
      printf("Error allocating memory on host for d_Input:   %s\n", hipGetErrorString(err));
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    cudaCalloc((void **)&d_Buffer, newImageSize, sizeof(dataType));

    cudaCalloc((void **)&d_OutputGPU, newImageSize, sizeof(dataType));
  }

  if (imageW < 32)
  {
    block_size = imageW;
    numberOfBlocks = 1;
  }
  else
  {
    block_size = 32;
    numberOfBlocks = imageW / block_size;
  }

  dim3 threadsPerBlock(block_size, block_size);   //geometry for block
  dim3 numBlocks(numberOfBlocks, numberOfBlocks); //geometry for grid
  int SH_MEM_SIZE_PAD = 32 + 2 * filter_radius;

  //Initializations
  {
    srand(200);
    // Random initialization of h_Filter
    for (i = 0; i < FILTER_LENGTH; i++)
    {
      h_Filter[i] = (dataType)(rand() % 16);
    }

    // Random initialization of h_Input
    for (i = filter_radius; i < (imageH + filter_radius); i++)
    {
      for (j = filter_radius; j < (imageW + filter_radius); j++)
      {
        h_Input[i * imageWithPaddingW + j] = (dataType)rand() / ((dataType)RAND_MAX / 255) + (dataType)rand() / (dataType)RAND_MAX;
      }
    }
  }

  //CPU Computation
  {
    // To parakatw einai to kommati pou ekteleitai sthn CPU kai me vash auto prepei na ginei h sugrish me thn GPU.
    printf("CPU computation is about to start...\n");
    //Get the starting time
    clock_gettime(CLOCK_MONOTONIC_RAW, &tv1);
    convolutionRowCPU(h_Buffer, h_Input, h_Filter, imageW, imageH, filter_radius);        // convolution kata grammes
    convolutionColumnCPU(h_OutputCPU, h_Buffer, h_Filter, imageW, imageH, filter_radius); // convolution kata sthles
    //Take the end time
    clock_gettime(CLOCK_MONOTONIC_RAW, &tv2);

    printf("CPU computation finished...\n");
  }

  //Calculate the duration of the CPU computation and report it
  {
    printf("\033[1;33m");
    printf("CPU time = %10g seconds\n",
           (double)(tv2.tv_nsec - tv1.tv_nsec) / 1000000000.0 +
               (double)(tv2.tv_sec - tv1.tv_sec));
  }
  printf("\033[0m");

  //Copy from host to device
  {
    hipEventCreate(&start);
    hipEventCreate(&stop);
    printf("Copy host memory to device\n");

    hipEventRecord(start, 0);
    //Copy host memory to device
    err = hipMemcpyToSymbol(HIP_SYMBOL(d_Filter), h_Filter, FILTER_LENGTH * sizeof(dataType));
    if (err != hipSuccess)
    {
      printf("Error during hipMemcpyToSymbol of h_Filter to d_Filter:  %s\n", hipGetErrorString(err));
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
    err = hipMemcpy(d_Input, h_Input, newImageSize * sizeof(dataType), hipMemcpyHostToDevice);
    if (err != hipSuccess)
    {
      printf("Error during hipMemcpy of h_Input to d_Input:  %s\n", hipGetErrorString(err));
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }
  }

  //GPU Computation
  {
    printf("GPU computation is about to start...\n");

    //kernel for row convolution
    //execute grid of numBlocks blocks of threadsPerBlock threads each
    convolutionRowSharedMem<<<numBlocks, threadsPerBlock, (32 *( 32 + 2 * filter_radius)) * sizeof(dataType)>>>(d_Input, d_Buffer, filter_radius, imageW, SH_MEM_SIZE_PAD);

    err = hipDeviceSynchronize();
    if (err != hipSuccess)
    {
      printf("Error during cudaDeviceSynchronize:  %s\n", hipGetErrorString(err));
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }

    //Error Checking
    cudaErrorCheck();

    //kernel for column convolution
    //execute grid of numBlocks blocks of threadsPerBlock threads each
    convolutionColumnSharedMem<<<numBlocks, threadsPerBlock, (32 * (32 + 2 * filter_radius)) * sizeof(dataType)>>>(d_Buffer, d_OutputGPU, filter_radius, imageW, imageH, SH_MEM_SIZE_PAD);

    err = hipMemcpy(h_OutputGPU, d_OutputGPU, newImageSize * sizeof(dataType), hipMemcpyDeviceToHost);
    if (err != hipSuccess)
    {
      printf("Error during hipMemcpy of d_OutputGPU to h_OutputGPU:  %s\n", hipGetErrorString(err));
      freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);
      return (ERROR);
    }

    //Error Checking
    cudaErrorCheck();
    hipEventRecord(stop, 0);
    printf("GPU computation finished...\n");
  }

  //Execution Time of GPU
  {
    hipEventSynchronize(stop);
    hipEventElapsedTime(&elapsed, start, stop);
    printf("\033[1;35m");
    printf("GPU time = %g ms\n", elapsed);
    printf("\033[0m");
    hipEventDestroy(start);
    hipEventDestroy(stop);
  }

  //Compare the results from CPU and GPU
  {
    for (i = filter_radius; i < imageH + filter_radius; i++)
    {
      for (j = filter_radius; j < imageW + filter_radius; j++)
      {
        diff = ABS(h_OutputCPU[i * imageWithPaddingW + j] - h_OutputGPU[i * imageWithPaddingW + j]);
        //printf("The difference between h_OutputCPU[%d]=%lf and h_OutputGPU[%d]=%lf is diff = %g\n", i * imageWithPaddingW + j, h_OutputCPU[i * imageWithPaddingW + j], i * imageWithPaddingW + j, h_OutputGPU[i * imageWithPaddingW + j], diff);
        if (diff > max_diff)
        {
          max_diff = diff;
        }
        if (diff > accuracy)
        {
          //printf("\t|->ERROR: The difference between the values of h_OutputCPU and h_OutputGPU at index i = %u is bigger than the given accuracy.\n", i);
        }
      }
    }

    if (max_diff > accuracy)
    {
      printf("\033[1;31m");
      printf("ERROR! Max difference between the values of h_OutputCPU and h_OutputGPU is max_diff = %g\n", max_diff);
    }
    else
    {
      printf("\033[1;32m");
      printf("Max difference between the values of h_OutputCPU and h_OutputGPU is max_diff = %g\n", max_diff);
    }
  }

  //Free allocated host and device memory
  printf("\033[0m");
  freeMemory(h_Filter, h_Input, h_Buffer, h_OutputCPU, h_OutputGPU, d_Input, d_Buffer, d_OutputGPU);

  return 0;
}

	.text
	.file	"Convolution2D_tiled_with_padding_doubles.hip"
	.globl	_Z29__device_stub__convolutionRowPdS_ii # -- Begin function _Z29__device_stub__convolutionRowPdS_ii
	.type	_Z29__device_stub__convolutionRowPdS_ii,@function
_Z29__device_stub__convolutionRowPdS_ii: # @_Z29__device_stub__convolutionRowPdS_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z14convolutionRowPdS_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z29__device_stub__convolutionRowPdS_ii, .Lfunc_end0-_Z29__device_stub__convolutionRowPdS_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z32__device_stub__convolutionColumnPdS_iii # -- Begin function _Z32__device_stub__convolutionColumnPdS_iii
	.type	_Z32__device_stub__convolutionColumnPdS_iii,@function
_Z32__device_stub__convolutionColumnPdS_iii: # @_Z32__device_stub__convolutionColumnPdS_iii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	4(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z17convolutionColumnPdS_iii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z32__device_stub__convolutionColumnPdS_iii, .Lfunc_end1-_Z32__device_stub__convolutionColumnPdS_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z38__device_stub__convolutionRowSharedMemPdS_iii # -- Begin function _Z38__device_stub__convolutionRowSharedMemPdS_iii
	.type	_Z38__device_stub__convolutionRowSharedMemPdS_iii,@function
_Z38__device_stub__convolutionRowSharedMemPdS_iii: # @_Z38__device_stub__convolutionRowSharedMemPdS_iii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	4(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z23convolutionRowSharedMemPdS_iii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z38__device_stub__convolutionRowSharedMemPdS_iii, .Lfunc_end2-_Z38__device_stub__convolutionRowSharedMemPdS_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z41__device_stub__convolutionColumnSharedMemPdS_iiii # -- Begin function _Z41__device_stub__convolutionColumnSharedMemPdS_iiii
	.type	_Z41__device_stub__convolutionColumnSharedMemPdS_iiii,@function
_Z41__device_stub__convolutionColumnSharedMemPdS_iiii: # @_Z41__device_stub__convolutionColumnSharedMemPdS_iiii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	4(%rsp), %rcx
	movl	%r8d, (%rcx)
	movq	%rsp, %r8
	movl	%r9d, (%r8)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z26convolutionColumnSharedMemPdS_iiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z41__device_stub__convolutionColumnSharedMemPdS_iiii, .Lfunc_end3-_Z41__device_stub__convolutionColumnSharedMemPdS_iiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z17convolutionRowCPUPdS_S_iii  # -- Begin function _Z17convolutionRowCPUPdS_S_iii
	.type	_Z17convolutionRowCPUPdS_S_iii,@function
_Z17convolutionRowCPUPdS_S_iii:         # @_Z17convolutionRowCPUPdS_S_iii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
                                        # kill: def $r9d killed $r9d def $r9
                                        # kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -48(%rsp)                 # 8-byte Spill
	movq	%rdi, -24(%rsp)                 # 8-byte Spill
	testl	%r8d, %r8d
	jle	.LBB4_9
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdx, %r15
	movabsq	$4294967296, %rax               # imm = 0x100000000
	addl	%r9d, %r8d
	movq	-48(%rsp), %r10                 # 8-byte Reload
	leal	(%r10,%r9,2), %ecx
	leal	(%r9,%r10), %edx
	movl	%r9d, %edi
	negl	%edi
	movslq	%edi, %rdi
	movslq	%r9d, %r12
	movslq	%edx, %r11
	movslq	%ecx, %rbx
	movslq	%r8d, %rcx
	movq	%rcx, -8(%rsp)                  # 8-byte Spill
	leal	(%r10,%r9,2), %ecx
	incl	%ecx
	movl	%r12d, %edx
	imull	%ecx, %edx
	shlq	$32, %rdx
	movq	%rdi, %r8
	shlq	$32, %r8
	addq	%rdx, %r8
	movq	%rbx, -40(%rsp)                 # 8-byte Spill
	shlq	$32, %rbx
	movq	%rbx, -16(%rsp)                 # 8-byte Spill
	leaq	(,%r12,8), %rdx
	shlq	$3, %rdi
	subq	%rdi, %rdx
	addq	%rdx, %r15
	leal	1(,%r9,2), %edi
	movq	%r12, -32(%rsp)                 # 8-byte Spill
.LBB4_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_4 Depth 2
                                        #       Child Loop BB4_6 Depth 3
	cmpl	$0, -48(%rsp)                   # 4-byte Folded Reload
	jle	.LBB4_8
# %bb.3:                                # %.lr.ph38
                                        #   in Loop: Header=BB4_2 Depth=1
	movq	%r12, %rdx
	imulq	-40(%rsp), %rdx                 # 8-byte Folded Reload
	movq	-24(%rsp), %rcx                 # 8-byte Reload
	leaq	(%rcx,%rdx,8), %r13
	movq	%r8, %rcx
	movq	-32(%rsp), %r10                 # 8-byte Reload
.LBB4_4:                                #   Parent Loop BB4_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB4_6 Depth 3
	xorpd	%xmm0, %xmm0
	testl	%r9d, %r9d
	js	.LBB4_7
# %bb.5:                                # %.lr.ph
                                        #   in Loop: Header=BB4_4 Depth=2
	movl	%edi, %ebp
	movq	%r15, %rdx
	movq	%rcx, %rbx
.LBB4_6:                                #   Parent Loop BB4_2 Depth=1
                                        #     Parent Loop BB4_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movq	%rbx, %r14
	sarq	$29, %r14
	movsd	(%rsi,%r14), %xmm1              # xmm1 = mem[0],zero
	mulsd	(%rdx), %xmm1
	addsd	%xmm1, %xmm0
	addq	%rax, %rbx
	addq	$-8, %rdx
	decl	%ebp
	jne	.LBB4_6
.LBB4_7:                                # %._crit_edge
                                        #   in Loop: Header=BB4_4 Depth=2
	movsd	%xmm0, (%r13,%r10,8)
	incq	%r10
	addq	%rax, %rcx
	cmpq	%r11, %r10
	jl	.LBB4_4
.LBB4_8:                                # %._crit_edge39
                                        #   in Loop: Header=BB4_2 Depth=1
	incq	%r12
	addq	-16(%rsp), %r8                  # 8-byte Folded Reload
	cmpq	-8(%rsp), %r12                  # 8-byte Folded Reload
	jl	.LBB4_2
.LBB4_9:                                # %._crit_edge41
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z17convolutionRowCPUPdS_S_iii, .Lfunc_end4-_Z17convolutionRowCPUPdS_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z20convolutionColumnCPUPdS_S_iii # -- Begin function _Z20convolutionColumnCPUPdS_S_iii
	.type	_Z20convolutionColumnCPUPdS_S_iii,@function
_Z20convolutionColumnCPUPdS_S_iii:      # @_Z20convolutionColumnCPUPdS_S_iii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
                                        # kill: def $r9d killed $r9d def $r9
                                        # kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -24(%rsp)                 # 8-byte Spill
	movq	%rdi, -8(%rsp)                  # 8-byte Spill
	testl	%r8d, %r8d
	jle	.LBB5_9
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdx, %r10
	movq	%rsi, %rcx
	addl	%r9d, %r8d
	movq	-24(%rsp), %rdx                 # 8-byte Reload
	leal	(%rdx,%r9,2), %eax
	addl	%r9d, %edx
	movl	%r9d, %esi
	negl	%esi
	movslq	%esi, %rsi
	movslq	%eax, %rbx
	movslq	%r9d, %r14
	movslq	%edx, %r11
	movslq	%r8d, %r8
	leaq	(,%r14,8), %rax
	leaq	(,%rsi,8), %rdx
	addq	%r14, %rsi
	imulq	%rbx, %rsi
	leaq	(%rax,%rsi,8), %rsi
	subq	%rdx, %rax
	addq	%rax, %r10
	addq	%rsi, %rcx
	movq	%rbx, -16(%rsp)                 # 8-byte Spill
	leaq	(,%rbx,8), %rbx
	leal	1(,%r9,2), %eax
	movq	%r14, %rdi
.LBB5_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_4 Depth 2
                                        #       Child Loop BB5_6 Depth 3
	cmpl	$0, -24(%rsp)                   # 4-byte Folded Reload
	jle	.LBB5_8
# %bb.3:                                # %.lr.ph38
                                        #   in Loop: Header=BB5_2 Depth=1
	movq	%r14, %rdx
	imulq	-16(%rsp), %rdx                 # 8-byte Folded Reload
	movq	-8(%rsp), %rsi                  # 8-byte Reload
	leaq	(%rsi,%rdx,8), %r15
	movq	%rcx, %rsi
	movq	%rdi, %r13
.LBB5_4:                                #   Parent Loop BB5_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB5_6 Depth 3
	xorpd	%xmm0, %xmm0
	testl	%r9d, %r9d
	js	.LBB5_7
# %bb.5:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB5_4 Depth=2
	movl	%eax, %ebp
	movq	%rsi, %r12
	movq	%r10, %rdx
.LBB5_6:                                # %.lr.ph
                                        #   Parent Loop BB5_2 Depth=1
                                        #     Parent Loop BB5_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movsd	(%r12), %xmm1                   # xmm1 = mem[0],zero
	mulsd	(%rdx), %xmm1
	addsd	%xmm1, %xmm0
	addq	$-8, %rdx
	addq	%rbx, %r12
	decl	%ebp
	jne	.LBB5_6
.LBB5_7:                                # %._crit_edge
                                        #   in Loop: Header=BB5_4 Depth=2
	movsd	%xmm0, (%r15,%r13,8)
	incq	%r13
	addq	$8, %rsi
	cmpq	%r11, %r13
	jl	.LBB5_4
.LBB5_8:                                # %._crit_edge39
                                        #   in Loop: Header=BB5_2 Depth=1
	incq	%r14
	addq	%rbx, %rcx
	cmpq	%r8, %r14
	jl	.LBB5_2
.LBB5_9:                                # %._crit_edge41
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z20convolutionColumnCPUPdS_S_iii, .Lfunc_end5-_Z20convolutionColumnCPUPdS_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z10freeMemoryPdS_S_S_S_S_S_S_  # -- Begin function _Z10freeMemoryPdS_S_S_S_S_S_S_
	.type	_Z10freeMemoryPdS_S_S_S_S_S_S_,@function
_Z10freeMemoryPdS_S_S_S_S_S_S_:         # @_Z10freeMemoryPdS_S_S_S_S_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, %rbx
	movq	%r8, %rbp
	movq	%rcx, %r13
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	$.Lstr, %edi
	callq	puts@PLT
	testq	%rbp, %rbp
	je	.LBB6_2
# %bb.1:
	movq	%rbp, %rdi
	callq	free
.LBB6_2:
	testq	%r13, %r13
	je	.LBB6_4
# %bb.3:
	movq	%r13, %rdi
	callq	free
.LBB6_4:
	testq	%r12, %r12
	je	.LBB6_6
# %bb.5:
	movq	%r12, %rdi
	callq	free
.LBB6_6:
	testq	%r15, %r15
	je	.LBB6_8
# %bb.7:
	movq	%r15, %rdi
	callq	free
.LBB6_8:
	movq	72(%rsp), %r15
	testq	%r14, %r14
	je	.LBB6_10
# %bb.9:
	movq	%r14, %rdi
	callq	free
.LBB6_10:
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	testq	%r15, %r15
	je	.LBB6_13
# %bb.11:
	movq	%r15, %rdi
	callq	hipFree
	testl	%eax, %eax
	je	.LBB6_13
# %bb.12:
	movl	$.L.str.2, %ebx
	jmp	.LBB6_21
.LBB6_13:
	movq	64(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB6_16
# %bb.14:
	callq	hipFree
	testl	%eax, %eax
	je	.LBB6_16
# %bb.15:
	movl	$.L.str.3, %ebx
	jmp	.LBB6_21
.LBB6_16:
	testq	%rbx, %rbx
	je	.LBB6_19
# %bb.17:
	movq	%rbx, %rdi
	callq	hipFree
	testl	%eax, %eax
	je	.LBB6_19
# %bb.18:
	movl	$.L.str.4, %ebx
	jmp	.LBB6_21
.LBB6_19:
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	callq	hipDeviceReset
	testl	%eax, %eax
	je	.LBB6_23
# %bb.20:
	movl	$.L.str.6, %ebx
.LBB6_21:                               # %.sink.split
	movl	%eax, %edi
	callq	hipGetErrorString
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$-1, %eax
.LBB6_22:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB6_23:
	.cfi_def_cfa_offset 64
	xorl	%eax, %eax
	jmp	.LBB6_22
.Lfunc_end6:
	.size	_Z10freeMemoryPdS_S_S_S_S_S_S_, .Lfunc_end6-_Z10freeMemoryPdS_S_S_S_S_S_S_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI7_0:
	.quad	0x416010100fefeff0              # double 8421504.4980392158
.LCPI7_1:
	.quad	0x41dfffffffc00000              # double 2147483647
.LCPI7_2:
	.quad	0x41cdcd6500000000              # double 1.0E+9
.LCPI7_4:
	.quad	0x3f0a36e2eb1c432d              # double 5.0000000000000002E-5
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI7_3:
	.quad	0x8000000000000000              # double -0
	.quad	0x8000000000000000              # double -0
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$200, %rsp
	.cfi_def_cfa_offset 256
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	xorl	%eax, %eax
	movq	%rax, 24(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, 8(%rsp)
	movl	$.L.str.7, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.8, %edi
	movl	$filter_radius, %esi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	filter_radius(%rip), %eax
	leal	1(,%rax,2), %esi
	movl	$.L.str.9, %edi
	xorl	%eax, %eax
	callq	printf
	leaq	36(%rsp), %rbx
	movl	$.L.str.8, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	(%rbx), %r13d
	movl	filter_radius(%rip), %r15d
	leal	(%r13,%r15,2), %ebp
	movl	$.L.str.10, %edi
	movl	%r13d, %esi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.10, %edi
	movl	%ebp, %esi
	movl	%ebp, %edx
	xorl	%eax, %eax
	callq	printf
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movl	filter_radius(%rip), %eax
	addl	%eax, %eax
	leaq	8(,%rax,8), %rdi
	callq	malloc
	testq	%rax, %rax
	je	.LBB7_1
# %bb.7:
	movq	%rax, %r14
	movl	%ebp, %r12d
	imull	%r12d, %r12d
	movl	$8, %esi
	movq	%r12, %rdi
	callq	calloc
	testq	%rax, %rax
	je	.LBB7_8
# %bb.9:
	movq	%rax, %rbx
	movq	%r15, 128(%rsp)                 # 8-byte Spill
	movl	$8, %esi
	movq	%r12, %rdi
	callq	calloc
	testq	%rax, %rax
	je	.LBB7_10
# %bb.11:
	movq	%rax, %r15
	movl	%ebp, 76(%rsp)                  # 4-byte Spill
	movl	$8, %esi
	movq	%r12, %rdi
	callq	calloc
	testq	%rax, %rax
	je	.LBB7_12
# %bb.13:
	movq	%rax, %rbp
	movl	$8, %esi
	movq	%r12, %rdi
	callq	calloc
	testq	%rax, %rax
	je	.LBB7_14
# %bb.15:
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	shlq	$3, %r12
	leaq	24(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB7_18
# %bb.16:
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.18, %edi
	jmp	.LBB7_17
.LBB7_1:
	movl	$.L.str.12, %edi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %r9
	xorl	%edi, %edi
	jmp	.LBB7_2
.LBB7_8:
	movl	$.L.str.13, %edi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %r9
	movq	%r14, %rdi
.LBB7_2:
	xorl	%esi, %esi
.LBB7_3:
	xorl	%edx, %edx
.LBB7_4:
	xorl	%ecx, %ecx
.LBB7_5:
	xorl	%r8d, %r8d
.LBB7_6:
	pushq	8(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	24(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z10freeMemoryPdS_S_S_S_S_S_S_
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$-1, %ebp
.LBB7_60:
	movl	%ebp, %eax
	addq	$200, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB7_10:
	.cfi_def_cfa_offset 256
	movl	$.L.str.14, %edi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %r9
	movq	%r14, %rdi
	movq	%rbx, %rsi
	jmp	.LBB7_3
.LBB7_12:
	movl	$.L.str.15, %edi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %r9
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	jmp	.LBB7_4
.LBB7_14:
	movl	$.L.str.16, %edi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %r9
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movq	%rbp, %rcx
	jmp	.LBB7_5
.LBB7_18:
	leaq	16(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB7_19
# %bb.20:
	movq	16(%rsp), %rdi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	hipMemset
	leaq	8(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB7_21
.LBB7_19:
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.19, %edi
.LBB7_17:
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %r9
	movq	%r14, %rdi
	movq	%rbx, %rsi
.LBB7_38:
	movq	%r15, %rdx
	movq	%rbp, %rcx
.LBB7_39:
	movq	40(%rsp), %r8                   # 8-byte Reload
	jmp	.LBB7_6
.LBB7_21:
	movq	%rbp, 48(%rsp)                  # 8-byte Spill
	movq	%r15, 80(%rsp)                  # 8-byte Spill
	movq	%rbx, 56(%rsp)                  # 8-byte Spill
	movq	128(%rsp), %rax                 # 8-byte Reload
	addl	%eax, %eax
	movq	%rax, 128(%rsp)                 # 8-byte Spill
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	hipMemset
	movl	36(%rsp), %eax
	movl	%eax, %ecx
	shrl	$5, %ecx
	cmpl	$32, %eax
	movl	$1, %edx
	cmovgel	%ecx, %edx
	movq	%rdx, 152(%rsp)                 # 8-byte Spill
	movl	$32, %ecx
	cmovll	%eax, %ecx
	movq	%rcx, 144(%rsp)                 # 8-byte Spill
	movl	filter_radius(%rip), %eax
	addl	%eax, %eax
	movl	%eax, 72(%rsp)                  # 4-byte Spill
	movl	$200, %edi
	callq	srand
	movq	$-1, %rbx
.LBB7_22:                               # =>This Inner Loop Header: Depth=1
	callq	rand
                                        # kill: def $eax killed $eax def $rax
	leal	15(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	andl	$-16, %ecx
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	movsd	%xmm0, 8(%r14,%rbx,8)
	movl	filter_radius(%rip), %eax
	leal	(%rax,%rax), %ecx
	incq	%rbx
	cmpq	%rcx, %rbx
	jb	.LBB7_22
# %bb.23:                               # %.preheader275
	movq	%r14, 64(%rsp)                  # 8-byte Spill
	leal	(%rax,%r13), %ecx
	cmpl	%ecx, %eax
	jae	.LBB7_29
# %bb.24:                               # %.preheader274.preheader
	movl	36(%rsp), %ecx
	movl	76(%rsp), %edx                  # 4-byte Reload
	movl	%edx, %ebx
	imull	%eax, %ebx
	movl	%edx, %edx
	movq	%rdx, 120(%rsp)                 # 8-byte Spill
	movl	%eax, %r15d
	movq	56(%rsp), %rbp                  # 8-byte Reload
.LBB7_25:                               # %.preheader274
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_27 Depth 2
	leal	(%rax,%rcx), %edx
	cmpl	%edx, %eax
	jae	.LBB7_28
# %bb.26:                               # %.lr.ph
                                        #   in Loop: Header=BB7_25 Depth=1
	movl	%eax, %r14d
.LBB7_27:                               #   Parent Loop BB7_25 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	.LCPI7_0(%rip), %xmm0
	movsd	%xmm0, 96(%rsp)                 # 8-byte Spill
	callq	rand
	movsd	.LCPI7_1(%rip), %xmm1           # xmm1 = mem[0],zero
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	%xmm1, %xmm0
	addsd	96(%rsp), %xmm0                 # 8-byte Folded Reload
	leal	(%rbx,%r14), %eax
	movsd	%xmm0, (%rbp,%rax,8)
	incq	%r14
	movl	36(%rsp), %ecx
	movl	filter_radius(%rip), %eax
	leal	(%rax,%rcx), %edx
	cmpq	%rdx, %r14
	jb	.LBB7_27
.LBB7_28:                               # %._crit_edge
                                        #   in Loop: Header=BB7_25 Depth=1
	incl	%r15d
	leal	(%rax,%r13), %edx
	addq	120(%rsp), %rbx                 # 8-byte Folded Reload
	cmpl	%edx, %r15d
	jb	.LBB7_25
.LBB7_29:                               # %._crit_edge279
	movl	$.Lstr.5, %edi
	callq	puts@PLT
	leaq	168(%rsp), %rsi
	movl	$4, %edi
	callq	clock_gettime
	movl	36(%rsp), %ebx
	movl	filter_radius(%rip), %r14d
	movq	80(%rsp), %rbp                  # 8-byte Reload
	movq	%rbp, %rdi
	movq	56(%rsp), %rsi                  # 8-byte Reload
	movq	64(%rsp), %r15                  # 8-byte Reload
	movq	%r15, %rdx
	movl	%ebx, %ecx
	movl	%r13d, %r8d
	movl	%r14d, %r9d
	callq	_Z17convolutionRowCPUPdS_S_iii
	movq	48(%rsp), %rdi                  # 8-byte Reload
	movq	%rbp, %rsi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	movl	%r13d, %r8d
	movl	%r14d, %r9d
	callq	_Z20convolutionColumnCPUPdS_S_iii
	leaq	184(%rsp), %r14
	movl	$4, %edi
	movq	%r14, %rsi
	callq	clock_gettime
	movl	$.Lstr.6, %edi
	callq	puts@PLT
	movl	$.L.str.22, %edi
	xorl	%eax, %eax
	callq	printf
	movq	(%r14), %rax
	movq	8(%r14), %rcx
	leaq	168(%rsp), %rdx
	subq	8(%rdx), %rcx
	xorps	%xmm1, %xmm1
	cvtsi2sd	%rcx, %xmm1
	divsd	.LCPI7_2(%rip), %xmm1
	subq	(%rdx), %rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	addsd	%xmm1, %xmm0
	movl	$.L.str.23, %edi
	movb	$1, %al
	callq	printf
	movl	$.L.str.24, %edi
	xorl	%eax, %eax
	callq	printf
	leaq	136(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventCreate
	leaq	88(%rsp), %rdi
	callq	hipEventCreate
	movl	$.Lstr.7, %edi
	callq	puts@PLT
	movq	(%rbx), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movl	filter_radius(%rip), %eax
	addl	%eax, %eax
	leaq	8(,%rax,8), %rdx
	movl	$d_Filter, %edi
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	testl	%eax, %eax
	je	.LBB7_31
# %bb.30:
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %r9
	movq	%r15, %rdi
	movq	56(%rsp), %rsi                  # 8-byte Reload
	movq	%rbp, %rdx
.LBB7_47:
	movq	48(%rsp), %rcx                  # 8-byte Reload
	jmp	.LBB7_39
.LBB7_31:
	movq	48(%rsp), %rbx                  # 8-byte Reload
	movq	%rbp, %r15
	movq	24(%rsp), %rdi
	movq	56(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	je	.LBB7_33
# %bb.32:
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.27, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %r9
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%rbx, %rcx
	jmp	.LBB7_39
.LBB7_33:
	movq	144(%rsp), %rcx                 # 8-byte Reload
	movq	%rcx, %rbp
	shlq	$32, %rbp
	movq	152(%rsp), %rax                 # 8-byte Reload
	movq	%rax, %r14
	shlq	$32, %r14
	orq	%rcx, %rbp
	orq	%rax, %r14
	addl	$32, 72(%rsp)                   # 4-byte Folded Spill
	movl	$.Lstr.8, %edi
	callq	puts@PLT
	movl	filter_radius(%rip), %r8d
	shll	$6, %r8d
	addl	$1024, %r8d                     # imm = 0x400
	shlq	$3, %r8
	movq	%r14, 120(%rsp)                 # 8-byte Spill
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbp, 96(%rsp)                  # 8-byte Spill
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_35
# %bb.34:
	movq	24(%rsp), %rdi
	movq	16(%rsp), %rsi
	movl	filter_radius(%rip), %edx
	movl	36(%rsp), %ecx
	movl	72(%rsp), %r8d                  # 4-byte Reload
	callq	_Z38__device_stub__convolutionRowSharedMemPdS_iii
.LBB7_35:
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	movq	48(%rsp), %rbp                  # 8-byte Reload
	movq	56(%rsp), %r14                  # 8-byte Reload
	je	.LBB7_40
# %bb.36:
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.29, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB7_37
.LBB7_40:
	callq	hipGetLastError
	testl	%eax, %eax
	je	.LBB7_42
# %bb.41:
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.30, %edi
	movl	$.L.str.31, %esi
	movl	$506, %edx                      # imm = 0x1FA
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	printf
.LBB7_37:
	movq	24(%rsp), %r9
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movq	%r14, %rsi
	jmp	.LBB7_38
.LBB7_42:
	movl	filter_radius(%rip), %r8d
	shll	$6, %r8d
	addl	$1024, %r8d                     # imm = 0x400
	shlq	$3, %r8
	movq	120(%rsp), %rdi                 # 8-byte Reload
	movl	$1, %esi
	movq	96(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_44
# %bb.43:
	movq	16(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	filter_radius(%rip), %edx
	movl	36(%rsp), %ecx
	movl	%r13d, %r8d
	movl	72(%rsp), %r9d                  # 4-byte Reload
	callq	_Z41__device_stub__convolutionColumnSharedMemPdS_iiii
.LBB7_44:
	movq	8(%rsp), %rsi
	movq	40(%rsp), %rdi                  # 8-byte Reload
	movq	%r12, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	je	.LBB7_48
# %bb.45:
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.32, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB7_46
.LBB7_48:
	callq	hipGetLastError
	testl	%eax, %eax
	je	.LBB7_50
# %bb.49:
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.30, %edi
	movl	$.L.str.31, %esi
	movl	$521, %edx                      # imm = 0x209
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	printf
.LBB7_46:
	movq	24(%rsp), %r9
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movq	56(%rsp), %rsi                  # 8-byte Reload
	movq	80(%rsp), %rdx                  # 8-byte Reload
	jmp	.LBB7_47
.LBB7_50:
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movl	$.Lstr.9, %edi
	callq	puts@PLT
	movq	88(%rsp), %rdi
	callq	hipEventSynchronize
	movq	136(%rsp), %rsi
	movq	88(%rsp), %rdx
	leaq	164(%rsp), %r12
	movq	%r12, %rdi
	callq	hipEventElapsedTime
	movl	$.L.str.34, %edi
	xorl	%eax, %eax
	callq	printf
	cvtss2sd	(%r12), %xmm0
	movl	$.L.str.35, %edi
	movb	$1, %al
	callq	printf
	movl	$.L.str.24, %edi
	xorl	%eax, %eax
	callq	printf
	movq	136(%rsp), %rdi
	callq	hipEventDestroy
	movq	88(%rsp), %rdi
	callq	hipEventDestroy
	movl	filter_radius(%rip), %eax
	leal	(%rax,%r13), %ecx
	xorps	%xmm0, %xmm0
	movaps	%xmm0, 96(%rsp)                 # 16-byte Spill
	cmpl	%ecx, %eax
	jae	.LBB7_58
# %bb.51:                               # %.preheader.lr.ph
	movl	36(%rsp), %edx
	addl	%eax, %edx
	movq	%rdx, %rsi
	subq	%rax, %rsi
	movq	128(%rsp), %rdi                 # 8-byte Reload
	addl	%r13d, %edi
	incl	%edi
	imull	%eax, %edi
	xorpd	%xmm3, %xmm3
	movapd	.LCPI7_3(%rip), %xmm0           # xmm0 = [-0.0E+0,-0.0E+0]
	movl	%eax, %r8d
	movq	48(%rsp), %rbx                  # 8-byte Reload
	movl	76(%rsp), %ebp                  # 4-byte Reload
	movq	40(%rsp), %r14                  # 8-byte Reload
.LBB7_52:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_54 Depth 2
	cmpl	%edx, %eax
	jae	.LBB7_55
# %bb.53:                               # %.lr.ph282
                                        #   in Loop: Header=BB7_52 Depth=1
	movq	%rsi, %r9
	movl	%edi, %r10d
	movapd	%xmm3, %xmm1
.LBB7_54:                               #   Parent Loop BB7_52 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r10d, %r11d
	movsd	(%rbx,%r11,8), %xmm2            # xmm2 = mem[0],zero
	subsd	(%r14,%r11,8), %xmm2
	movapd	%xmm2, %xmm3
	xorpd	%xmm0, %xmm3
	maxsd	%xmm2, %xmm3
	maxsd	%xmm1, %xmm3
	incl	%r10d
	movapd	%xmm3, %xmm1
	decq	%r9
	jne	.LBB7_54
.LBB7_55:                               # %._crit_edge283
                                        #   in Loop: Header=BB7_52 Depth=1
	incl	%r8d
	addl	%ebp, %edi
	cmpl	%ecx, %r8d
	jne	.LBB7_52
# %bb.56:                               # %._crit_edge286
	movapd	%xmm3, 96(%rsp)                 # 16-byte Spill
	ucomisd	.LCPI7_4(%rip), %xmm3
	jbe	.LBB7_58
# %bb.57:
	movl	$.L.str.36, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.37, %edi
	jmp	.LBB7_59
.LBB7_58:                               # %._crit_edge286.thread
	movl	$.L.str.38, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.39, %edi
.LBB7_59:
	movapd	96(%rsp), %xmm0                 # 16-byte Reload
	movb	$1, %al
	callq	printf
	xorl	%ebp, %ebp
	movl	$.L.str.24, %edi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %r9
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movq	56(%rsp), %rsi                  # 8-byte Reload
	movq	80(%rsp), %rdx                  # 8-byte Reload
	movq	48(%rsp), %rcx                  # 8-byte Reload
	movq	40(%rsp), %r8                   # 8-byte Reload
	pushq	8(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	24(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z10freeMemoryPdS_S_S_S_S_S_S_
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	jmp	.LBB7_60
.Lfunc_end7:
	.size	main, .Lfunc_end7-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB8_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB8_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14convolutionRowPdS_ii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z17convolutionColumnPdS_iii, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z23convolutionRowSharedMemPdS_iii, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z26convolutionColumnSharedMemPdS_iiii, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$0, 8(%rsp)
	movl	$1, (%rsp)
	movl	$d_Filter, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movl	$65536, %r9d                    # imm = 0x10000
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end8:
	.size	__hip_module_ctor, .Lfunc_end8-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB9_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB9_2:
	retq
.Lfunc_end9:
	.size	__hip_module_dtor, .Lfunc_end9-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	filter_radius,@object           # @filter_radius
	.bss
	.globl	filter_radius
	.p2align	2, 0x0
filter_radius:
	.long	0                               # 0x0
	.size	filter_radius, 4

	.type	d_Filter,@object                # @d_Filter
	.local	d_Filter
	.comm	d_Filter,65536,16
	.type	_Z14convolutionRowPdS_ii,@object # @_Z14convolutionRowPdS_ii
	.section	.rodata,"a",@progbits
	.globl	_Z14convolutionRowPdS_ii
	.p2align	3, 0x0
_Z14convolutionRowPdS_ii:
	.quad	_Z29__device_stub__convolutionRowPdS_ii
	.size	_Z14convolutionRowPdS_ii, 8

	.type	_Z17convolutionColumnPdS_iii,@object # @_Z17convolutionColumnPdS_iii
	.globl	_Z17convolutionColumnPdS_iii
	.p2align	3, 0x0
_Z17convolutionColumnPdS_iii:
	.quad	_Z32__device_stub__convolutionColumnPdS_iii
	.size	_Z17convolutionColumnPdS_iii, 8

	.type	_Z23convolutionRowSharedMemPdS_iii,@object # @_Z23convolutionRowSharedMemPdS_iii
	.globl	_Z23convolutionRowSharedMemPdS_iii
	.p2align	3, 0x0
_Z23convolutionRowSharedMemPdS_iii:
	.quad	_Z38__device_stub__convolutionRowSharedMemPdS_iii
	.size	_Z23convolutionRowSharedMemPdS_iii, 8

	.type	_Z26convolutionColumnSharedMemPdS_iiii,@object # @_Z26convolutionColumnSharedMemPdS_iiii
	.globl	_Z26convolutionColumnSharedMemPdS_iiii
	.p2align	3, 0x0
_Z26convolutionColumnSharedMemPdS_iiii:
	.quad	_Z41__device_stub__convolutionColumnSharedMemPdS_iiii
	.size	_Z26convolutionColumnSharedMemPdS_iiii, 8

	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"Error during hipFree (d_OutputGPU):  %s\n"
	.size	.L.str.2, 41

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Error during hipFree (d_Buffer):  %s\n"
	.size	.L.str.3, 38

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Error during hipFree (d_Input):  %s\n"
	.size	.L.str.4, 37

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Error during cudaDeviceReset:  %s\n"
	.size	.L.str.6, 35

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Enter filter radius : "
	.size	.L.str.7, 23

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"%d"
	.size	.L.str.8, 3

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Enter image size. Should be a power of two and greater than %d : "
	.size	.L.str.9, 66

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Image Width x Height = %i x %i\n\n"
	.size	.L.str.10, 33

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Error allocating memory on host for h_Filter"
	.size	.L.str.12, 45

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Error allocating memory on host for h_Input"
	.size	.L.str.13, 44

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Error allocating memory on host for h_Buffer"
	.size	.L.str.14, 45

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"Error allocating memory on host for h_OutputCPU"
	.size	.L.str.15, 48

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"Error allocating memory on host for h_OutputGPU"
	.size	.L.str.16, 48

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"Error allocating memory on host for d_Input:   %s\n"
	.size	.L.str.18, 51

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"Error allocating memory on host:   %s\n"
	.size	.L.str.19, 39

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"\033[1;33m"
	.size	.L.str.22, 8

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"CPU time = %10g seconds\n"
	.size	.L.str.23, 25

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"\033[0m"
	.size	.L.str.24, 5

	.type	.L.str.26,@object               # @.str.26
.L.str.26:
	.asciz	"Error during hipMemcpyToSymbol of h_Filter to d_Filter:  %s\n"
	.size	.L.str.26, 61

	.type	.L.str.27,@object               # @.str.27
.L.str.27:
	.asciz	"Error during hipMemcpy of h_Input to d_Input:  %s\n"
	.size	.L.str.27, 51

	.type	.L.str.29,@object               # @.str.29
.L.str.29:
	.asciz	"Error during cudaDeviceSynchronize:  %s\n"
	.size	.L.str.29, 41

	.type	.L.str.30,@object               # @.str.30
.L.str.30:
	.asciz	"Cuda Error Found %s:%d:  '%s'\n"
	.size	.L.str.30, 31

	.type	.L.str.31,@object               # @.str.31
.L.str.31:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/ChrisGeorgakidis/High-Performance-Computing/master/Lab_4/Convolution2D_tiled_with_padding_doubles.hip"
	.size	.L.str.31, 164

	.type	.L.str.32,@object               # @.str.32
.L.str.32:
	.asciz	"Error during hipMemcpy of d_OutputGPU to h_OutputGPU:  %s\n"
	.size	.L.str.32, 59

	.type	.L.str.34,@object               # @.str.34
.L.str.34:
	.asciz	"\033[1;35m"
	.size	.L.str.34, 8

	.type	.L.str.35,@object               # @.str.35
.L.str.35:
	.asciz	"GPU time = %g ms\n"
	.size	.L.str.35, 18

	.type	.L.str.36,@object               # @.str.36
.L.str.36:
	.asciz	"\033[1;31m"
	.size	.L.str.36, 8

	.type	.L.str.37,@object               # @.str.37
.L.str.37:
	.asciz	"ERROR! Max difference between the values of h_OutputCPU and h_OutputGPU is max_diff = %g\n"
	.size	.L.str.37, 90

	.type	.L.str.38,@object               # @.str.38
.L.str.38:
	.asciz	"\033[1;32m"
	.size	.L.str.38, 8

	.type	.L.str.39,@object               # @.str.39
.L.str.39:
	.asciz	"Max difference between the values of h_OutputCPU and h_OutputGPU is max_diff = %g\n"
	.size	.L.str.39, 83

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z14convolutionRowPdS_ii"
	.size	.L__unnamed_1, 25

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z17convolutionColumnPdS_iii"
	.size	.L__unnamed_2, 29

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z23convolutionRowSharedMemPdS_iii"
	.size	.L__unnamed_3, 35

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z26convolutionColumnSharedMemPdS_iiii"
	.size	.L__unnamed_4, 39

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"d_Filter"
	.size	.L__unnamed_5, 9

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Free host memory..."
	.size	.Lstr, 20

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Free device memory..."
	.size	.Lstr.1, 22

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"Reset Device"
	.size	.Lstr.2, 13

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Allocating and initializing host arrays..."
	.size	.Lstr.3, 43

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"Allocate device (GPU) memory"
	.size	.Lstr.4, 29

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"CPU computation is about to start..."
	.size	.Lstr.5, 37

	.type	.Lstr.6,@object                 # @str.6
.Lstr.6:
	.asciz	"CPU computation finished..."
	.size	.Lstr.6, 28

	.type	.Lstr.7,@object                 # @str.7
.Lstr.7:
	.asciz	"Copy host memory to device"
	.size	.Lstr.7, 27

	.type	.Lstr.8,@object                 # @str.8
.Lstr.8:
	.asciz	"GPU computation is about to start..."
	.size	.Lstr.8, 37

	.type	.Lstr.9,@object                 # @str.9
.Lstr.9:
	.asciz	"GPU computation finished..."
	.size	.Lstr.9, 28

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z29__device_stub__convolutionRowPdS_ii
	.addrsig_sym _Z32__device_stub__convolutionColumnPdS_iii
	.addrsig_sym _Z38__device_stub__convolutionRowSharedMemPdS_iii
	.addrsig_sym _Z41__device_stub__convolutionColumnSharedMemPdS_iiii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym filter_radius
	.addrsig_sym d_Filter
	.addrsig_sym _Z14convolutionRowPdS_ii
	.addrsig_sym _Z17convolutionColumnPdS_iii
	.addrsig_sym _Z23convolutionRowSharedMemPdS_iii
	.addrsig_sym _Z26convolutionColumnSharedMemPdS_iiii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z14convolutionRowPdS_ii ; -- Begin function _Z14convolutionRowPdS_ii
	.globl	_Z14convolutionRowPdS_ii
	.p2align	8
	.type	_Z14convolutionRowPdS_ii,@function
_Z14convolutionRowPdS_ii:               ; @_Z14convolutionRowPdS_ii
; %bb.0:
	s_clause 0x2
	s_load_b32 s4, s[0:1], 0x24
	s_load_b64 s[8:9], s[0:1], 0x10
	s_load_b128 s[0:3], s[0:1], 0x0
	v_and_b32_e32 v4, 0x3ff, v0
	v_bfe_u32 v1, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s5, s4, 16
	s_and_b32 s6, s4, 0xffff
	s_mul_i32 s15, s15, s5
	s_mul_i32 s14, s14, s6
	s_lshl_b32 s4, s8, 1
	v_add3_u32 v0, s14, s8, v4
	v_add3_u32 v6, s15, s8, v1
	s_add_i32 s6, s4, s9
	s_cmp_gt_i32 s8, -1
	s_cbranch_scc0 .LBB0_4
; %bb.1:                                ; %.lr.ph
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mul_lo_u32 v5, v6, s6
	v_mov_b32_e32 v1, 0
	v_dual_mov_b32 v2, 0 :: v_dual_add_nc_u32 v3, v5, v0
	v_add3_u32 v4, v4, v5, s14
.LBB0_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)
	v_ashrrev_i32_e32 v5, 31, v4
	s_getpc_b64 s[8:9]
	s_add_u32 s8, s8, d_Filter@rel32@lo+4
	s_addc_u32 s9, s9, d_Filter@rel32@hi+12
	s_ashr_i32 s5, s4, 31
	s_lshl_b64 s[10:11], s[4:5], 3
	v_lshlrev_b64 v[7:8], 3, v[4:5]
	s_add_u32 s8, s10, s8
	s_addc_u32 s9, s11, s9
	v_add_nc_u32_e32 v4, 1, v4
	s_load_b64 s[8:9], s[8:9], 0x0
	s_add_i32 s4, s4, -1
	v_add_co_u32 v7, vcc_lo, s0, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s1, v8, vcc_lo
	s_cmp_lg_u32 s4, -1
	global_load_b64 v[7:8], v[7:8], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fma_f64 v[1:2], v[7:8], s[8:9], v[1:2]
	s_cbranch_scc1 .LBB0_2
; %bb.3:                                ; %Flow
	s_mov_b32 s0, 0
	s_branch .LBB0_5
.LBB0_4:
	s_mov_b32 s0, -1
                                        ; implicit-def: $vgpr1_vgpr2
                                        ; implicit-def: $vgpr3
.LBB0_5:                                ; %Flow46
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 vcc_lo, exec_lo, s0
	s_cbranch_vccz .LBB0_7
; %bb.6:                                ; %.._crit_edge_crit_edge
	s_delay_alu instid0(VALU_DEP_1)
	v_mad_u64_u32 v[3:4], null, v6, s6, v[0:1]
	v_mov_b32_e32 v1, 0
	v_mov_b32_e32 v2, 0
.LBB0_7:                                ; %._crit_edge
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[3:4], 3, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v3, vcc_lo, s2, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s3, v4, vcc_lo
	global_store_b64 v[3:4], v[1:2], off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14convolutionRowPdS_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z14convolutionRowPdS_ii, .Lfunc_end0-_Z14convolutionRowPdS_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 336
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z17convolutionColumnPdS_iii ; -- Begin function _Z17convolutionColumnPdS_iii
	.globl	_Z17convolutionColumnPdS_iii
	.p2align	8
	.type	_Z17convolutionColumnPdS_iii,@function
_Z17convolutionColumnPdS_iii:           ; @_Z17convolutionColumnPdS_iii
; %bb.0:
	s_load_b64 s[4:5], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s4, 0
	s_cbranch_scc1 .LBB1_3
; %bb.1:                                ; %.lr.ph
	s_load_b32 s2, s[0:1], 0x2c
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	v_mad_u64_u32 v[4:5], null, s15, s3, v[1:2]
	s_mul_i32 s14, s14, s2
	s_load_b128 s[0:3], s[0:1], 0x0
	v_add3_u32 v5, s14, s4, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_add_nc_u32_e32 v2, s4, v4
	s_lshl_b32 s4, s4, 1
	s_add_i32 s6, s4, s5
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[0:1], null, v2, s6, v[5:6]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_lshlrev_b64 v[6:7], 3, v[0:1]
	v_mov_b32_e32 v0, 0
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_3)
	v_mad_u64_u32 v[2:3], null, v4, s6, v[5:6]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v4, vcc_lo, s2, v6
	v_add_co_ci_u32_e32 v5, vcc_lo, s3, v7, vcc_lo
.LBB1_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)
	v_ashrrev_i32_e32 v3, 31, v2
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, d_Filter@rel32@lo+4
	s_addc_u32 s3, s3, d_Filter@rel32@hi+12
	s_ashr_i32 s5, s4, 31
	s_lshl_b64 s[8:9], s[4:5], 3
	v_lshlrev_b64 v[6:7], 3, v[2:3]
	s_add_u32 s2, s8, s2
	s_addc_u32 s3, s9, s3
	v_add_nc_u32_e32 v2, s6, v2
	s_load_b64 s[2:3], s[2:3], 0x0
	s_add_i32 s4, s4, -1
	v_add_co_u32 v6, vcc_lo, s0, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s1, v7, vcc_lo
	s_cmp_lg_u32 s4, -1
	global_load_b64 v[6:7], v[6:7], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fma_f64 v[0:1], v[6:7], s[2:3], v[0:1]
	global_store_b64 v[4:5], v[0:1], off
	s_cbranch_scc1 .LBB1_2
.LBB1_3:                                ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17convolutionColumnPdS_iii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 8
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z17convolutionColumnPdS_iii, .Lfunc_end1-_Z17convolutionColumnPdS_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 296
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z23convolutionRowSharedMemPdS_iii ; -- Begin function _Z23convolutionRowSharedMemPdS_iii
	.globl	_Z23convolutionRowSharedMemPdS_iii
	.p2align	8
	.type	_Z23convolutionRowSharedMemPdS_iii,@function
_Z23convolutionRowSharedMemPdS_iii:     ; @_Z23convolutionRowSharedMemPdS_iii
; %bb.0:
	s_clause 0x1
	s_load_b32 s9, s[0:1], 0x2c
	s_load_b256 s[0:7], s[0:1], 0x0
	v_bfe_u32 v5, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s7, s9, 16
	s_lshl_b32 s8, s4, 1
	s_mul_i32 s15, s15, s7
	s_add_i32 s5, s8, s5
	v_add3_u32 v1, s15, s4, v5
	s_and_b32 s7, s9, 0xffff
	s_cmp_lt_i32 s6, 32
	s_mul_i32 s14, s14, s7
	s_delay_alu instid0(SALU_CYCLE_1)
	v_add_nc_u32_e32 v4, s14, v0
	v_mul_lo_u32 v3, v1, s5
	s_cbranch_scc1 .LBB2_3
; %bb.1:                                ; %.lr.ph
	s_ashr_i32 s5, s6, 31
	v_mul_lo_u32 v1, v5, s6
	s_lshr_b32 s5, s5, 27
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s5, s6, s5
	s_ashr_i32 s5, s5, 5
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_sub_i32 s7, 1, s5
	v_mad_u64_u32 v[6:7], null, s5, v0, v[1:2]
	v_mul_lo_u32 v1, v4, s5
	s_mul_i32 s7, s7, s14
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshl_add_u32 v6, v6, 3, 0
	v_add3_u32 v1, s7, v1, v3
.LBB2_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_lshlrev_b64 v[7:8], 3, v[1:2]
	v_add_nc_u32_e32 v1, 1, v1
	s_add_i32 s5, s5, -1
	s_cmp_eq_u32 s5, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v7, vcc_lo, s0, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s1, v8, vcc_lo
	global_load_b64 v[7:8], v[7:8], off
	s_waitcnt vmcnt(0)
	ds_store_b64 v6, v[7:8]
	v_add_nc_u32_e32 v6, 8, v6
	s_cbranch_scc0 .LBB2_2
.LBB2_3:                                ; %._crit_edge
	v_mov_b32_e32 v1, 0
	v_mov_b32_e32 v2, 0
	s_cmp_lt_i32 s4, 0
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB2_6
; %bb.4:                                ; %.lr.ph50
	v_mad_u64_u32 v[6:7], null, v5, s6, v[0:1]
	v_mov_b32_e32 v1, 0
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_3)
	v_lshl_add_u32 v0, v6, 3, 0
.LBB2_5:                                ; =>This Inner Loop Header: Depth=1
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, d_Filter@rel32@lo+4
	s_addc_u32 s1, s1, d_Filter@rel32@hi+12
	s_ashr_i32 s9, s8, 31
	ds_load_b64 v[5:6], v0
	s_lshl_b64 s[6:7], s[8:9], 3
	v_add_nc_u32_e32 v0, 8, v0
	s_add_u32 s0, s6, s0
	s_addc_u32 s1, s7, s1
	s_add_i32 s8, s8, -1
	s_load_b64 s[0:1], s[0:1], 0x0
	s_cmp_lg_u32 s8, -1
	s_waitcnt lgkmcnt(0)
	v_fma_f64 v[1:2], v[5:6], s[0:1], v[1:2]
	s_cbranch_scc1 .LBB2_5
.LBB2_6:                                ; %._crit_edge51
	v_add3_u32 v3, v4, s4, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[3:4], 3, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v3, vcc_lo, s2, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s3, v4, vcc_lo
	global_store_b64 v[3:4], v[1:2], off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z23convolutionRowSharedMemPdS_iii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z23convolutionRowSharedMemPdS_iii, .Lfunc_end2-_Z23convolutionRowSharedMemPdS_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 448
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z26convolutionColumnSharedMemPdS_iiii ; -- Begin function _Z26convolutionColumnSharedMemPdS_iiii
	.globl	_Z26convolutionColumnSharedMemPdS_iiii
	.p2align	8
	.type	_Z26convolutionColumnSharedMemPdS_iiii,@function
_Z26convolutionColumnSharedMemPdS_iiii: ; @_Z26convolutionColumnSharedMemPdS_iiii
; %bb.0:
	s_clause 0x3
	s_load_b32 s6, s[0:1], 0x2c
	s_load_b64 s[4:5], s[0:1], 0x10
	s_load_b32 s7, s[0:1], 0x1c
	s_load_b128 s[0:3], s[0:1], 0x0
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v4, v0, 10, 10
	s_delay_alu instid0(VALU_DEP_2)
	v_lshlrev_b32_e32 v5, 3, v1
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s8, s6, 16
	s_and_b32 s9, s6, 0xffff
	s_mul_i32 s15, s15, s8
	v_add_nc_u32_e32 v2, s4, v1
	s_lshl_b32 s6, s4, 1
	v_add_nc_u32_e32 v3, s15, v4
	s_add_i32 s5, s6, s5
	s_cmp_lt_i32 s7, 32
	s_mul_i32 s14, s14, s9
	s_cbranch_scc1 .LBB3_3
; %bb.1:                                ; %.lr.ph
	s_ashr_i32 s8, s7, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshr_b32 s8, s8, 27
	s_add_i32 s7, s7, s8
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_ashr_i32 s7, s7, 5
	v_mul_lo_u32 v0, v3, s7
	s_sub_i32 s8, 1, s7
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[6:7], null, s8, s15, v[0:1]
	v_mul_lo_u32 v0, v4, s7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_lo_u32 v1, v6, s5
	v_lshlrev_b32_e32 v0, 8, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add3_u32 v6, v0, v5, 0
	v_add3_u32 v0, v2, v1, s14
	v_mov_b32_e32 v1, 0
.LBB3_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_lshlrev_b64 v[7:8], 3, v[0:1]
	v_add_nc_u32_e32 v0, s5, v0
	s_add_i32 s7, s7, -1
	s_cmp_eq_u32 s7, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v7, vcc_lo, s0, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s1, v8, vcc_lo
	global_load_b64 v[7:8], v[7:8], off
	s_waitcnt vmcnt(0)
	ds_store_b64 v6, v[7:8]
	v_add_nc_u32_e32 v6, 0x100, v6
	s_cbranch_scc0 .LBB3_2
.LBB3_3:                                ; %._crit_edge
	v_mov_b32_e32 v0, 0
	v_mov_b32_e32 v1, 0
	s_cmp_lt_i32 s4, 0
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB3_6
; %bb.4:                                ; %.lr.ph49.preheader
	v_lshlrev_b32_e32 v4, 8, v4
	v_mov_b32_e32 v0, 0
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_3)
	v_add3_u32 v4, v4, v5, 0
.LBB3_5:                                ; %.lr.ph49
                                        ; =>This Inner Loop Header: Depth=1
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, d_Filter@rel32@lo+4
	s_addc_u32 s1, s1, d_Filter@rel32@hi+12
	s_ashr_i32 s7, s6, 31
	ds_load_b64 v[5:6], v4
	s_lshl_b64 s[8:9], s[6:7], 3
	v_add_nc_u32_e32 v4, 0x100, v4
	s_add_u32 s0, s8, s0
	s_addc_u32 s1, s9, s1
	s_add_i32 s6, s6, -1
	s_load_b64 s[0:1], s[0:1], 0x0
	s_cmp_lg_u32 s6, -1
	s_waitcnt lgkmcnt(0)
	v_fma_f64 v[0:1], v[5:6], s[0:1], v[0:1]
	s_cbranch_scc1 .LBB3_5
.LBB3_6:                                ; %._crit_edge50
	v_add_nc_u32_e32 v3, s4, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v3, v3, s5
	v_add3_u32 v2, v2, s14, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[2:3], 3, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s2, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s3, v3, vcc_lo
	global_store_b64 v[2:3], v[0:1], off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z26convolutionColumnSharedMemPdS_iiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end3:
	.size	_Z26convolutionColumnSharedMemPdS_iiii, .Lfunc_end3-_Z26convolutionColumnSharedMemPdS_iiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 492
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	d_Filter                ; @d_Filter
	.type	d_Filter,@object
	.section	.bss,"aw",@nobits
	.globl	d_Filter
	.p2align	4, 0x0
d_Filter:
	.zero	65536
	.size	d_Filter, 65536

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym d_Filter
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14convolutionRowPdS_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z14convolutionRowPdS_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z17convolutionColumnPdS_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z17convolutionColumnPdS_iii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         152
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z23convolutionRowSharedMemPdS_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z23convolutionRowSharedMemPdS_iii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         152
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z26convolutionColumnSharedMemPdS_iiii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z26convolutionColumnSharedMemPdS_iiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
