#include <ctime>
#include <stdio.h>
#include <cuda_runtime.h>
#include <iostream>
#include <vector>

#define RED 2
#define GREEN 1
#define BLUE 0


using namespace std;

extern "C"
cudaError_t cuda_main()
{
    const int kb = 1024;
    const int mb = kb * kb;
    wcout << "NBody.GPU" << endl << "=========" << endl << endl;


    int devCount;
    cudaGetDeviceCount(&devCount);
    wcout << "Dispositivo CUDA : " << endl << endl;

    for(int i = 0; i < devCount; ++i)
    {
        cudaDeviceProp props;
        cudaGetDeviceProperties(&props, i);
        wcout << i << ": " << props.name << ": " << props.major << "." << props.minor << endl;
        wcout << "Memoria global:   " << props.totalGlobalMem / mb << "mb" << endl;
        wcout << "Memoria compartida:   " << props.sharedMemPerBlock / kb << "kb" << endl;
        wcout << "Memoria constante: " << props.totalConstMem / kb << "kb" << endl;
        wcout << "Registros por bloque: " << props.regsPerBlock << endl << endl;
        wcout << "Multi Processor Count: " << props.multiProcessorCount << endl << endl;

        wcout << "Tamano Warp :         " << props.warpSize << endl;
        wcout << "Threads por block: " << props.maxThreadsPerBlock << endl;
        wcout << "Dimension Max block : [ " << props.maxThreadsDim[0] << ", " << props.maxThreadsDim[1]  << ", " << props.maxThreadsDim[2] << " ]" << endl;
        wcout << "Dimension Max grid :  [ " << props.maxGridSize[0] << ", " << props.maxGridSize[1]  << ", " << props.maxGridSize[2] << " ]" << endl;
        wcout << endl;
    }

    return cudaGetLastError();
}

//funcion device
__device__ unsigned char clamp(int value){
    if(value < 0)
        value = 0;
    else
        if(value > 255)
            value = 255;
    return (unsigned char)value;
}

//funcion global de filtro
__global__ void Convolucion(char *M, unsigned char *imageInput, int width, int height, \
        unsigned int maskWidth,unsigned char *imageOutput){

    unsigned int row = blockIdx.y*blockDim.y+threadIdx.y;
    unsigned int col = blockIdx.x*blockDim.x+threadIdx.x;

    int Pvalue = 0;

    int start_row = row - (maskWidth/2);
    int start_col = col - (maskWidth/2);

    for(int i = 0; i < maskWidth; i++){
        for(int j = 0; j < maskWidth; j++ ){
            if((start_col + j >=0 && start_col + j < width) \
                    &&(start_row + i >=0 && start_row + i < height)){
                Pvalue += imageInput[(start_row + i)*width+(start_col + j)] * M[i*maskWidth+j];
            }
        }
    }
    imageOutput[row*width+col] = clamp(Pvalue);
}

//funcion global de escala de grises
__global__ void img2gray(unsigned char *imageInput, int width, int height, unsigned char *imageOutput){
    int row = blockIdx.y*blockDim.y+threadIdx.y;
    int col = blockIdx.x*blockDim.x+threadIdx.x;

    if((row < height) && (col < width)){
        imageOutput[row*width+col] = imageInput[(row*width+col)*3+RED]*0.299 + imageInput[(row*width+col)*3+GREEN]*0.587 \
                                     + imageInput[(row*width+col)*3+BLUE]*0.114;
    }
}

//funcion global de filtro
__global__ void FilterColor(char *M, unsigned char *imageInput, int width, int height, \
    unsigned int maskWidth,unsigned char *imageOutput, float coef){

    unsigned int row = blockIdx.y*blockDim.y+threadIdx.y;
    unsigned int col = blockIdx.x*blockDim.x+threadIdx.x;

    int Pvalue = 0.0;

    int start_row = row - (maskWidth/2);
    int start_col = col - (maskWidth/2);

    for(int i = 0; i < maskWidth; i++){
        for(int j = 0; j < maskWidth; j++ ){
            if((start_col + j >=0 && start_col + j < width) \
                    &&(start_row + i >=0 && start_row + i < height)){
                Pvalue += imageInput[(start_row + i)*width+(start_col + j)] * M[i*maskWidth+j]*coef;
            }
        }
    }
    imageOutput[row*width+col] = clamp(Pvalue);

}
cudaError_t  convolucionCuda(int width, int height, int size, int sizeGray, unsigned char *dataRawImage, unsigned char *&h_imageOutput, \
                             int MASK_WIDTH, char *h_M){
    cudaError_t error = cudaSuccess;
    clock_t startGPU, endGPU;
    double gpu_time;
    int sizeM = sizeof(char)*MASK_WIDTH*MASK_WIDTH;
    char *d_M;
    unsigned char *d_dataRawImage, *d_imageOutput, *d_sobelOutput;

    //Reserva de Memoria para M
    error = cudaMalloc((void**)&d_M,sizeM);
    if(error != cudaSuccess){
        printf("Error reservando memoria para d_M\n");
        exit(-1);
    }

    //Reserva de Memoria para d_dataRawImage
    error = cudaMalloc((void**)&d_dataRawImage,size);
    if(error != cudaSuccess){
        printf("Error reservando memoria para d_dataRawImage\n");
        exit(-1);
    }

    //Reserva de Memoria para d_imageOutput
    error = cudaMalloc((void**)&d_imageOutput,sizeGray);
    if(error != cudaSuccess){
        printf("Error reservando memoria para d_imageOutput\n");
        exit(-1);
    }

    //Reserva de Memoria para d_sobelOutput
    error = cudaMalloc((void**)&d_sobelOutput,sizeGray);
    if(error != cudaSuccess){
        printf("Error reservando memoria para d_sobelOutput\n");
        exit(-1);
    }

    //Algoritmo Paralelo con CUDA
    startGPU = clock();

    error = cudaMemcpy(d_dataRawImage,dataRawImage,size, cudaMemcpyHostToDevice);
    if(error != cudaSuccess){
       printf("Error copiando los datos de dataRawImage a d_dataRawImage \n");
       exit(-1);
    }

    error = cudaMemcpy(d_M,h_M,sizeM, cudaMemcpyHostToDevice);
    if(error != cudaSuccess){
       printf("Error copiando los datos de h_M a d_M \n");
       exit(-1);
    }

    int blockSize = 32;
    dim3 dimBlock(blockSize,blockSize,1);
    dim3 dimGrid(ceil(width/float(blockSize)),ceil(height/float(blockSize)),1);
    //llamamos la funcion de escala de grises
    img2gray<<<dimGrid,dimBlock>>>(d_dataRawImage,width,height,d_imageOutput);
    //Sincronizamos
    cudaDeviceSynchronize();
    //llamamos la funcion de filtro de sobel
    Convolucion<<<dimGrid,dimBlock>>>(d_M, d_imageOutput,width,height,MASK_WIDTH,d_sobelOutput);
    cudaMemcpy(h_imageOutput,d_sobelOutput,sizeGray,cudaMemcpyDeviceToHost);

    endGPU = clock();
    //fin algoritmo Paralelo con CUDA

    //imprimir tiempos de ejecucion
    gpu_time = ((double) (endGPU - startGPU)) / CLOCKS_PER_SEC;
    printf("Tiempo Algoritmo Paralelo CUDA: %.10f\n",gpu_time);

    //limpiar memoria
    cudaFree(d_dataRawImage);
    cudaFree(d_imageOutput);
    cudaFree(d_M);
    cudaFree(d_sobelOutput);

    return cudaGetLastError();
}


cudaError_t  convolucionCudaColor(int width, int height, int sizeGray, unsigned char * splB, unsigned char * splG, unsigned char * splR,\
                    unsigned char *&h_imageOutputB,unsigned char *&h_imageOutputG,unsigned char *&h_imageOutputR,\
                    int MASK_WIDTH, char *h_M, float coef){

    cudaError_t error = cudaSuccess;
    clock_t startGPU, endGPU;
    double gpu_time;
    int sizeM = sizeof(char)*MASK_WIDTH*MASK_WIDTH;
    char *d_M;
    unsigned char *d_dataRawImageB, *d_dataRawImageG, *d_dataRawImageR, *d_sobelOutput;

    //Reserva de Memoria para M
    error = cudaMalloc((void**)&d_M,sizeM);
    if(error != cudaSuccess){
        printf("Error reservando memoria para d_M\n");
        exit(-1);
    }

    error = cudaMalloc((void**)&d_dataRawImageB,sizeGray);
    error = cudaMalloc((void**)&d_dataRawImageG,sizeGray);
    error = cudaMalloc((void**)&d_dataRawImageR,sizeGray);
    if(error != cudaSuccess){
        printf("Error reservando memoria para d_dataRawImage\n");
        exit(-1);
    }


    //Reserva de Memoria para d_sobelOutput
    error = cudaMalloc((void**)&d_sobelOutput,sizeGray);
    if(error != cudaSuccess){
        printf("Error reservando memoria para d_sobelOutput\n");
        exit(-1);
    }

    //Algoritmo Paralelo con CUDA
    startGPU = clock();


    error = cudaMemcpy(d_M,h_M,sizeM, cudaMemcpyHostToDevice);
    if(error != cudaSuccess){
       printf("Error copiando los datos de h_M a d_M  \n");
       exit(-1);
    }

    int blockSize = 32;
    dim3 dimBlock(blockSize,blockSize,1);
    dim3 dimGrid(ceil(width/float(blockSize)),ceil(height/float(blockSize)),1);

    cudaDeviceSynchronize();

    error = cudaMemcpy(d_dataRawImageB,splB,sizeGray, cudaMemcpyHostToDevice);
    if(error != cudaSuccess){
        printf("Error copiando los datos de splB a d_dataRawImage \n");
        exit(-1);
    }
    FilterColor<<<dimGrid,dimBlock>>>(d_M, d_dataRawImageB,width,height,MASK_WIDTH,d_sobelOutput,coef);
    cudaMemcpy(h_imageOutputB,d_sobelOutput,sizeGray,cudaMemcpyDeviceToHost);
    cudaDeviceSynchronize();

    ///////////////////////////

    error = cudaMemcpy(d_dataRawImageG,splG,sizeGray, cudaMemcpyHostToDevice);
    if(error != cudaSuccess){
        printf("Error copiando los datos de splG a d_dataRawImage \n");
        exit(-1);
    }


    FilterColor<<<dimGrid,dimBlock>>>(d_M,d_dataRawImageG,width,height,MASK_WIDTH,d_sobelOutput,coef);
    cudaMemcpy(h_imageOutputG,d_sobelOutput,sizeGray,cudaMemcpyDeviceToHost);

    cudaDeviceSynchronize();

    /////////////////////////////

    error = cudaMemcpy(d_dataRawImageR,splR,sizeGray, cudaMemcpyHostToDevice);
    if(error != cudaSuccess){
        printf("Error copiando los datos de splR a d_dataRawImage \n");
        exit(-1);
    }

    FilterColor<<<dimGrid,dimBlock>>>(d_M,d_dataRawImageR,width,height,MASK_WIDTH,d_sobelOutput,coef);
    cudaMemcpy(h_imageOutputR,d_sobelOutput,sizeGray,cudaMemcpyDeviceToHost);
    cudaDeviceSynchronize();


    endGPU = clock();
    //fin algoritmo Paralelo con CUDA

    //imprimir tiempos de ejecucion
    gpu_time = ((double) (endGPU - startGPU)) / CLOCKS_PER_SEC;
    printf("Tiempo Algoritmo Paralelo CUDA: %.10f\n",gpu_time);

    //limpiar memoria
    cudaFree(d_dataRawImageB);
    cudaFree(d_dataRawImageG);
    cudaFree(d_dataRawImageR);

    cudaFree(d_M);
    cudaFree(d_sobelOutput);

    return cudaGetLastError();
}

	.file	"tmpxft_002b9026_00000000-6_cuda_code.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4004:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4004:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"NBody.GPU"
.LC1:
	.string	"========="
.LC2:
	.string	"Dispositivo CUDA : "
.LC3:
	.string	": "
.LC4:
	.string	"."
.LC5:
	.string	"Memoria global:   "
.LC6:
	.string	"mb"
.LC7:
	.string	"Memoria compartida:   "
.LC8:
	.string	"kb"
.LC9:
	.string	"Memoria constante: "
.LC10:
	.string	"Registros por bloque: "
.LC11:
	.string	"Multi Processor Count: "
.LC12:
	.string	"Tamano Warp :         "
.LC13:
	.string	"Threads por block: "
.LC14:
	.string	"Dimension Max block : [ "
.LC15:
	.string	", "
.LC16:
	.string	" ]"
.LC17:
	.string	"Dimension Max grid :  [ "
	.text
	.globl	cuda_main
	.type	cuda_main, @function
cuda_main:
.LFB3998:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC3(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	_ZSt5wcout(%rip), %rbx
	movq	%rbx, %rdi
	subq	$1056, %rsp
	.cfi_def_cfa_offset 1104
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	12(%rsp), %rdi
	call	cudaGetDeviceCount@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
.L3:
	cmpl	%ebp, 12(%rsp)
	jle	.L8
	leaq	16(%rsp), %r12
	movl	%ebp, %esi
	leaq	.LC16(%rip), %r14
	movq	%r12, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movl	%ebp, %esi
	movq	%rbx, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	%r12, %rsi
	leaq	.LC8(%rip), %r12
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	376(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	380(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	304(%rsp), %rsi
	movq	%rax, %rdi
	shrq	$20, %rsi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEE9_M_insertImEERS2_T_@PLT
	leaq	.LC6(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	312(%rsp), %rsi
	movq	%rax, %rdi
	shrq	$10, %rsi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEE9_M_insertImEERS2_T_@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	.LC9(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	368(%rsp), %rsi
	movq	%rax, %rdi
	shrq	$10, %rsi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEE9_M_insertImEERS2_T_@PLT
	movq	%r12, %rsi
	leaq	.LC15(%rip), %r12
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	.LC10(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	320(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	.LC11(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	404(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	.LC12(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	324(%rsp), %esi
	incl	%ebp
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	.LC13(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	336(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	.LC14(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	340(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	344(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	348(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	leaq	.LC17(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	352(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	356(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movl	360(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	movq	_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEPFRS2_S3_E@PLT
	jmp	.L3
.L8:
	call	cudaGetLastError@PLT
	movq	1048(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$1056, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3998:
	.size	cuda_main, .-cuda_main
	.globl	_Z5clampi
	.type	_Z5clampi, @function
_Z5clampi:
.LFB3999:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3999:
	.size	_Z5clampi, .-_Z5clampi
	.globl	_Z39__device_stub__Z11ConvolucionPcPhiijS0_PcPhiijS0_
	.type	_Z39__device_stub__Z11ConvolucionPcPhiijS0_PcPhiijS0_, @function
_Z39__device_stub__Z11ConvolucionPcPhiijS0_PcPhiijS0_:
.LFB4026:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movl	%edx, 28(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 24(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 20(%rsp)
	movq	%r9, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L11
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z11ConvolucionPcPhiijS0_(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L11:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4026:
	.size	_Z39__device_stub__Z11ConvolucionPcPhiijS0_PcPhiijS0_, .-_Z39__device_stub__Z11ConvolucionPcPhiijS0_PcPhiijS0_
	.globl	_Z11ConvolucionPcPhiijS0_
	.type	_Z11ConvolucionPcPhiijS0_, @function
_Z11ConvolucionPcPhiijS0_:
.LFB4027:
	.cfi_startproc
	endbr64
	jmp	_Z39__device_stub__Z11ConvolucionPcPhiijS0_PcPhiijS0_
	.cfi_endproc
.LFE4027:
	.size	_Z11ConvolucionPcPhiijS0_, .-_Z11ConvolucionPcPhiijS0_
	.globl	_Z31__device_stub__Z8img2grayPhiiS_PhiiS_
	.type	_Z31__device_stub__Z8img2grayPhiiS_PhiiS_, @function
_Z31__device_stub__Z8img2grayPhiiS_PhiiS_:
.LFB4028:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, 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	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%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	.L16
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z8img2grayPhiiS_(%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
.L16:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4028:
	.size	_Z31__device_stub__Z8img2grayPhiiS_PhiiS_, .-_Z31__device_stub__Z8img2grayPhiiS_PhiiS_
	.globl	_Z8img2grayPhiiS_
	.type	_Z8img2grayPhiiS_, @function
_Z8img2grayPhiiS_:
.LFB4029:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z8img2grayPhiiS_PhiiS_
	.cfi_endproc
.LFE4029:
	.size	_Z8img2grayPhiiS_, .-_Z8img2grayPhiiS_
	.section	.rodata.str1.1
.LC18:
	.string	"Error reservando memoria para d_M\n"
.LC19:
	.string	"Error reservando memoria para d_dataRawImage\n"
.LC20:
	.string	"Error reservando memoria para d_imageOutput\n"
.LC21:
	.string	"Error reservando memoria para d_sobelOutput\n"
.LC22:
	.string	"Error copiando los datos de dataRawImage a d_dataRawImage \n"
.LC23:
	.string	"Error copiando los datos de h_M a d_M \n"
.LC26:
	.string	"Tiempo Algoritmo Paralelo CUDA: %.10f\n"
	.text
	.globl	_Z15convolucionCudaiiiiPhRS_iPc
	.type	_Z15convolucionCudaiiiiPhRS_iPc, @function
_Z15convolucionCudaiiiiPhRS_iPc:
.LFB4000:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r9, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%ecx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%edx, %rbx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	168(%rsp), %rax
	movq	%r8, 16(%rsp)
	leaq	32(%rsp), %rdi
	movl	160(%rsp), %r15d
	movq	%rax, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	movl	%r15d, %eax
	imull	%r15d, %eax
	cltq
	movq	%rax, %rsi
	movq	%rax, 8(%rsp)
	call	cudaMalloc@PLT
	leaq	.LC18(%rip), %rsi
	testl	%eax, %eax
	jne	.L32
	leaq	40(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L23
	leaq	.LC19(%rip), %rsi
.L32:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %edi
	call	exit@PLT
.L23:
	movslq	%r13d, %rax
	leaq	48(%rsp), %rdi
	movq	%rax, %rsi
	movq	%rax, (%rsp)
	call	cudaMalloc@PLT
	leaq	.LC20(%rip), %rsi
	testl	%eax, %eax
	jne	.L32
	movq	(%rsp), %rsi
	leaq	56(%rsp), %rdi
	call	cudaMalloc@PLT
	leaq	.LC21(%rip), %rsi
	testl	%eax, %eax
	jne	.L32
	call	clock@PLT
	movq	16(%rsp), %rsi
	movq	40(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	%rax, %r13
	call	cudaMemcpy@PLT
	leaq	.LC22(%rip), %rsi
	testl	%eax, %eax
	jne	.L32
	movq	24(%rsp), %rsi
	movq	8(%rsp), %rdx
	movl	$1, %ecx
	movq	32(%rsp), %rdi
	call	cudaMemcpy@PLT
	leaq	.LC23(%rip), %rsi
	testl	%eax, %eax
	jne	.L32
	cvtsi2ssl	%r12d, %xmm0
	mulss	.LC24(%rip), %xmm0
	movabsq	$137438953504, %rbx
	movl	$1, 72(%rsp)
	movq	%rbx, 64(%rsp)
	call	ceilf@PLT
	movss	%xmm0, 8(%rsp)
	cvtsi2ssl	%ebp, %xmm0
	mulss	.LC24(%rip), %xmm0
	call	ceilf@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	cvttss2siq	%xmm0, %rax
	movss	8(%rsp), %xmm1
	movl	$1, %ecx
	movl	$1, %esi
	movl	$1, 84(%rsp)
	movl	%eax, 76(%rsp)
	cvttss2siq	%xmm1, %rax
	movl	%eax, 80(%rsp)
	movq	76(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L28
	movq	48(%rsp), %rcx
	movq	40(%rsp), %rdi
	movl	%r12d, %edx
	movl	%ebp, %esi
	call	_Z31__device_stub__Z8img2grayPhiiS_PhiiS_
.L28:
	call	cudaDeviceSynchronize@PLT
	movl	72(%rsp), %ecx
	movl	84(%rsp), %esi
	xorl	%r9d, %r9d
	movq	64(%rsp), %rdx
	movq	76(%rsp), %rdi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L29
	movq	56(%rsp), %r9
	movq	48(%rsp), %rsi
	movl	%r15d, %r8d
	movl	%r12d, %ecx
	movq	32(%rsp), %rdi
	movl	%ebp, %edx
	call	_Z39__device_stub__Z11ConvolucionPcPhiijS0_PcPhiijS0_
.L29:
	movq	(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	$2, %ecx
	movq	(%r14), %rdi
	call	cudaMemcpy@PLT
	call	clock@PLT
	leaq	.LC26(%rip), %rsi
	movl	$2, %edi
	subq	%r13, %rax
	cvtsi2sdq	%rax, %xmm0
	movb	$1, %al
	divsd	.LC25(%rip), %xmm0
	call	__printf_chk@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	call	cudaGetLastError@PLT
	movq	88(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	addq	$104, %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
.LFE4000:
	.size	_Z15convolucionCudaiiiiPhRS_iPc, .-_Z15convolucionCudaiiiiPhRS_iPc
	.globl	_Z40__device_stub__Z11FilterColorPcPhiijS0_fPcPhiijS0_f
	.type	_Z40__device_stub__Z11FilterColorPcPhiijS0_fPcPhiijS0_f, @function
_Z40__device_stub__Z11FilterColorPcPhiijS0_fPcPhiijS0_f:
.LFB4030:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movl	%edx, 28(%rsp)
	leaq	48(%rsp), %rdx
	movl	%ecx, 24(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 20(%rsp)
	movq	%r9, 8(%rsp)
	movss	%xmm0, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L33
	pushq	56(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z11FilterColorPcPhiijS0_f(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 208
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L33:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4030:
	.size	_Z40__device_stub__Z11FilterColorPcPhiijS0_fPcPhiijS0_f, .-_Z40__device_stub__Z11FilterColorPcPhiijS0_fPcPhiijS0_f
	.globl	_Z11FilterColorPcPhiijS0_f
	.type	_Z11FilterColorPcPhiijS0_f, @function
_Z11FilterColorPcPhiijS0_f:
.LFB4031:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z11FilterColorPcPhiijS0_fPcPhiijS0_f
	.cfi_endproc
.LFE4031:
	.size	_Z11FilterColorPcPhiijS0_f, .-_Z11FilterColorPcPhiijS0_f
	.section	.rodata.str1.1
.LC27:
	.string	"Error copiando los datos de h_M a d_M  \n"
.LC28:
	.string	"Error copiando los datos de splB a d_dataRawImage \n"
.LC29:
	.string	"Error copiando los datos de splG a d_dataRawImage \n"
.LC30:
	.string	"Error copiando los datos de splR a d_dataRawImage \n"
	.text
	.globl	_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf
	.type	_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf, @function
_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf:
.LFB4001:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%esi, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	216(%rsp), %rax
	movq	%rcx, 24(%rsp)
	leaq	72(%rsp), %rdi
	movl	232(%rsp), %ebp
	movq	%r8, 32(%rsp)
	movq	%rax, 48(%rsp)
	movq	240(%rsp), %rax
	imull	%ebp, %ebp
	movq	%r9, 40(%rsp)
	movq	208(%rsp), %r14
	movq	%rax, 56(%rsp)
	movq	224(%rsp), %rbx
	movss	%xmm0, 20(%rsp)
	movslq	%ebp, %rbp
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	leaq	.LC18(%rip), %rsi
	testl	%eax, %eax
	jne	.L51
	movslq	%r13d, %rax
	leaq	80(%rsp), %rdi
	movq	%rax, %rsi
	movq	%rax, 8(%rsp)
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	leaq	88(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	leaq	96(%rsp), %rdi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L40
	leaq	.LC19(%rip), %rsi
.L51:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %edi
	call	exit@PLT
.L40:
	movq	8(%rsp), %rsi
	leaq	104(%rsp), %rdi
	call	cudaMalloc@PLT
	leaq	.LC21(%rip), %rsi
	testl	%eax, %eax
	jne	.L51
	call	clock@PLT
	movq	56(%rsp), %rsi
	movq	72(%rsp), %rdi
	movq	%rbp, %rdx
	movl	$1, %ecx
	movq	%rax, %r13
	call	cudaMemcpy@PLT
	leaq	.LC27(%rip), %rsi
	testl	%eax, %eax
	jne	.L51
	cvtsi2ssl	%r15d, %xmm0
	mulss	.LC24(%rip), %xmm0
	movabsq	$137438953504, %rax
	movl	$1, 120(%rsp)
	movq	%rax, 112(%rsp)
	call	ceilf@PLT
	movd	%xmm0, %ebp
	cvtsi2ssl	%r12d, %xmm0
	mulss	.LC24(%rip), %xmm0
	call	ceilf@PLT
	movd	%ebp, %xmm1
	movl	$1, 132(%rsp)
	cvttss2siq	%xmm0, %rax
	movl	%eax, 124(%rsp)
	cvttss2siq	%xmm1, %rax
	movl	%eax, 128(%rsp)
	call	cudaDeviceSynchronize@PLT
	movq	24(%rsp), %rsi
	movq	8(%rsp), %rdx
	movl	$1, %ecx
	movq	80(%rsp), %rdi
	call	cudaMemcpy@PLT
	leaq	.LC28(%rip), %rsi
	testl	%eax, %eax
	jne	.L51
	movl	120(%rsp), %ecx
	movq	112(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	124(%rsp), %rdi
	movl	132(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L44
	movq	104(%rsp), %r9
	movq	80(%rsp), %rsi
	movl	%r15d, %ecx
	movl	%r12d, %edx
	movss	20(%rsp), %xmm0
	movl	232(%rsp), %r8d
	movq	72(%rsp), %rdi
	call	_Z40__device_stub__Z11FilterColorPcPhiijS0_fPcPhiijS0_f
.L44:
	movq	8(%rsp), %rdx
	movq	104(%rsp), %rsi
	movl	$2, %ecx
	movq	(%r14), %rdi
	call	cudaMemcpy@PLT
	call	cudaDeviceSynchronize@PLT
	movq	32(%rsp), %rsi
	movq	8(%rsp), %rdx
	movl	$1, %ecx
	movq	88(%rsp), %rdi
	call	cudaMemcpy@PLT
	leaq	.LC29(%rip), %rsi
	testl	%eax, %eax
	jne	.L51
	movl	120(%rsp), %ecx
	movq	112(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	124(%rsp), %rdi
	movl	132(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L46
	movq	104(%rsp), %r9
	movq	88(%rsp), %rsi
	movl	%r15d, %ecx
	movl	%r12d, %edx
	movss	20(%rsp), %xmm0
	movl	232(%rsp), %r8d
	movq	72(%rsp), %rdi
	call	_Z40__device_stub__Z11FilterColorPcPhiijS0_fPcPhiijS0_f
.L46:
	movq	48(%rsp), %rax
	movq	8(%rsp), %rdx
	movl	$2, %ecx
	movq	104(%rsp), %rsi
	movq	(%rax), %rdi
	call	cudaMemcpy@PLT
	call	cudaDeviceSynchronize@PLT
	movq	40(%rsp), %rsi
	movq	8(%rsp), %rdx
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	call	cudaMemcpy@PLT
	leaq	.LC30(%rip), %rsi
	testl	%eax, %eax
	jne	.L51
	movl	120(%rsp), %ecx
	movq	112(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	124(%rsp), %rdi
	movl	132(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L48
	movq	104(%rsp), %r9
	movq	96(%rsp), %rsi
	movl	%r15d, %ecx
	movl	%r12d, %edx
	movss	20(%rsp), %xmm0
	movl	232(%rsp), %r8d
	movq	72(%rsp), %rdi
	call	_Z40__device_stub__Z11FilterColorPcPhiijS0_fPcPhiijS0_f
.L48:
	movq	8(%rsp), %rdx
	movq	104(%rsp), %rsi
	movl	$2, %ecx
	movq	(%rbx), %rdi
	call	cudaMemcpy@PLT
	call	cudaDeviceSynchronize@PLT
	call	clock@PLT
	leaq	.LC26(%rip), %rsi
	movl	$2, %edi
	subq	%r13, %rax
	cvtsi2sdq	%rax, %xmm0
	movb	$1, %al
	divsd	.LC25(%rip), %xmm0
	call	__printf_chk@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	96(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	call	cudaGetLastError@PLT
	movq	136(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	addq	$152, %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
.LFE4001:
	.size	_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf, .-_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf
	.section	.rodata.str1.1
.LC31:
	.string	"_Z11FilterColorPcPhiijS0_f"
.LC32:
	.string	"_Z8img2grayPhiiS_"
.LC33:
	.string	"_Z11ConvolucionPcPhiijS0_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4033:
	.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	.LC31(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z11FilterColorPcPhiijS0_f(%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	.LC32(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z8img2grayPhiiS_(%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	.LC33(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11ConvolucionPcPhiijS0_(%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
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.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
.LFE4033:
	.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
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC24:
	.long	1023410176
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC25:
	.long	0
	.long	1093567616
	.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:

#include <ctime>
#include <stdio.h>
#include <hip/hip_runtime.h>
#include <iostream>
#include <vector>

#define RED 2
#define GREEN 1
#define BLUE 0


using namespace std;

extern "C"
hipError_t cuda_main()
{
    const int kb = 1024;
    const int mb = kb * kb;
    wcout << "NBody.GPU" << endl << "=========" << endl << endl;


    int devCount;
    hipGetDeviceCount(&devCount);
    wcout << "Dispositivo CUDA : " << endl << endl;

    for(int i = 0; i < devCount; ++i)
    {
        hipDeviceProp_t props;
        hipGetDeviceProperties(&props, i);
        wcout << i << ": " << props.name << ": " << props.major << "." << props.minor << endl;
        wcout << "Memoria global:   " << props.totalGlobalMem / mb << "mb" << endl;
        wcout << "Memoria compartida:   " << props.sharedMemPerBlock / kb << "kb" << endl;
        wcout << "Memoria constante: " << props.totalConstMem / kb << "kb" << endl;
        wcout << "Registros por bloque: " << props.regsPerBlock << endl << endl;
        wcout << "Multi Processor Count: " << props.multiProcessorCount << endl << endl;

        wcout << "Tamano Warp :         " << props.warpSize << endl;
        wcout << "Threads por block: " << props.maxThreadsPerBlock << endl;
        wcout << "Dimension Max block : [ " << props.maxThreadsDim[0] << ", " << props.maxThreadsDim[1]  << ", " << props.maxThreadsDim[2] << " ]" << endl;
        wcout << "Dimension Max grid :  [ " << props.maxGridSize[0] << ", " << props.maxGridSize[1]  << ", " << props.maxGridSize[2] << " ]" << endl;
        wcout << endl;
    }

    return hipGetLastError();
}

//funcion device
__device__ unsigned char clamp(int value){
    if(value < 0)
        value = 0;
    else
        if(value > 255)
            value = 255;
    return (unsigned char)value;
}

//funcion global de filtro
__global__ void Convolucion(char *M, unsigned char *imageInput, int width, int height, \
        unsigned int maskWidth,unsigned char *imageOutput){

    unsigned int row = blockIdx.y*blockDim.y+threadIdx.y;
    unsigned int col = blockIdx.x*blockDim.x+threadIdx.x;

    int Pvalue = 0;

    int start_row = row - (maskWidth/2);
    int start_col = col - (maskWidth/2);

    for(int i = 0; i < maskWidth; i++){
        for(int j = 0; j < maskWidth; j++ ){
            if((start_col + j >=0 && start_col + j < width) \
                    &&(start_row + i >=0 && start_row + i < height)){
                Pvalue += imageInput[(start_row + i)*width+(start_col + j)] * M[i*maskWidth+j];
            }
        }
    }
    imageOutput[row*width+col] = clamp(Pvalue);
}

//funcion global de escala de grises
__global__ void img2gray(unsigned char *imageInput, int width, int height, unsigned char *imageOutput){
    int row = blockIdx.y*blockDim.y+threadIdx.y;
    int col = blockIdx.x*blockDim.x+threadIdx.x;

    if((row < height) && (col < width)){
        imageOutput[row*width+col] = imageInput[(row*width+col)*3+RED]*0.299 + imageInput[(row*width+col)*3+GREEN]*0.587 \
                                     + imageInput[(row*width+col)*3+BLUE]*0.114;
    }
}

//funcion global de filtro
__global__ void FilterColor(char *M, unsigned char *imageInput, int width, int height, \
    unsigned int maskWidth,unsigned char *imageOutput, float coef){

    unsigned int row = blockIdx.y*blockDim.y+threadIdx.y;
    unsigned int col = blockIdx.x*blockDim.x+threadIdx.x;

    int Pvalue = 0.0;

    int start_row = row - (maskWidth/2);
    int start_col = col - (maskWidth/2);

    for(int i = 0; i < maskWidth; i++){
        for(int j = 0; j < maskWidth; j++ ){
            if((start_col + j >=0 && start_col + j < width) \
                    &&(start_row + i >=0 && start_row + i < height)){
                Pvalue += imageInput[(start_row + i)*width+(start_col + j)] * M[i*maskWidth+j]*coef;
            }
        }
    }
    imageOutput[row*width+col] = clamp(Pvalue);

}
hipError_t  convolucionCuda(int width, int height, int size, int sizeGray, unsigned char *dataRawImage, unsigned char *&h_imageOutput, \
                             int MASK_WIDTH, char *h_M){
    hipError_t error = hipSuccess;
    clock_t startGPU, endGPU;
    double gpu_time;
    int sizeM = sizeof(char)*MASK_WIDTH*MASK_WIDTH;
    char *d_M;
    unsigned char *d_dataRawImage, *d_imageOutput, *d_sobelOutput;

    //Reserva de Memoria para M
    error = hipMalloc((void**)&d_M,sizeM);
    if(error != hipSuccess){
        printf("Error reservando memoria para d_M\n");
        exit(-1);
    }

    //Reserva de Memoria para d_dataRawImage
    error = hipMalloc((void**)&d_dataRawImage,size);
    if(error != hipSuccess){
        printf("Error reservando memoria para d_dataRawImage\n");
        exit(-1);
    }

    //Reserva de Memoria para d_imageOutput
    error = hipMalloc((void**)&d_imageOutput,sizeGray);
    if(error != hipSuccess){
        printf("Error reservando memoria para d_imageOutput\n");
        exit(-1);
    }

    //Reserva de Memoria para d_sobelOutput
    error = hipMalloc((void**)&d_sobelOutput,sizeGray);
    if(error != hipSuccess){
        printf("Error reservando memoria para d_sobelOutput\n");
        exit(-1);
    }

    //Algoritmo Paralelo con CUDA
    startGPU = clock();

    error = hipMemcpy(d_dataRawImage,dataRawImage,size, hipMemcpyHostToDevice);
    if(error != hipSuccess){
       printf("Error copiando los datos de dataRawImage a d_dataRawImage \n");
       exit(-1);
    }

    error = hipMemcpy(d_M,h_M,sizeM, hipMemcpyHostToDevice);
    if(error != hipSuccess){
       printf("Error copiando los datos de h_M a d_M \n");
       exit(-1);
    }

    int blockSize = 32;
    dim3 dimBlock(blockSize,blockSize,1);
    dim3 dimGrid(ceil(width/float(blockSize)),ceil(height/float(blockSize)),1);
    //llamamos la funcion de escala de grises
    img2gray<<<dimGrid,dimBlock>>>(d_dataRawImage,width,height,d_imageOutput);
    //Sincronizamos
    hipDeviceSynchronize();
    //llamamos la funcion de filtro de sobel
    Convolucion<<<dimGrid,dimBlock>>>(d_M, d_imageOutput,width,height,MASK_WIDTH,d_sobelOutput);
    hipMemcpy(h_imageOutput,d_sobelOutput,sizeGray,hipMemcpyDeviceToHost);

    endGPU = clock();
    //fin algoritmo Paralelo con CUDA

    //imprimir tiempos de ejecucion
    gpu_time = ((double) (endGPU - startGPU)) / CLOCKS_PER_SEC;
    printf("Tiempo Algoritmo Paralelo CUDA: %.10f\n",gpu_time);

    //limpiar memoria
    hipFree(d_dataRawImage);
    hipFree(d_imageOutput);
    hipFree(d_M);
    hipFree(d_sobelOutput);

    return hipGetLastError();
}


hipError_t  convolucionCudaColor(int width, int height, int sizeGray, unsigned char * splB, unsigned char * splG, unsigned char * splR,\
                    unsigned char *&h_imageOutputB,unsigned char *&h_imageOutputG,unsigned char *&h_imageOutputR,\
                    int MASK_WIDTH, char *h_M, float coef){

    hipError_t error = hipSuccess;
    clock_t startGPU, endGPU;
    double gpu_time;
    int sizeM = sizeof(char)*MASK_WIDTH*MASK_WIDTH;
    char *d_M;
    unsigned char *d_dataRawImageB, *d_dataRawImageG, *d_dataRawImageR, *d_sobelOutput;

    //Reserva de Memoria para M
    error = hipMalloc((void**)&d_M,sizeM);
    if(error != hipSuccess){
        printf("Error reservando memoria para d_M\n");
        exit(-1);
    }

    error = hipMalloc((void**)&d_dataRawImageB,sizeGray);
    error = hipMalloc((void**)&d_dataRawImageG,sizeGray);
    error = hipMalloc((void**)&d_dataRawImageR,sizeGray);
    if(error != hipSuccess){
        printf("Error reservando memoria para d_dataRawImage\n");
        exit(-1);
    }


    //Reserva de Memoria para d_sobelOutput
    error = hipMalloc((void**)&d_sobelOutput,sizeGray);
    if(error != hipSuccess){
        printf("Error reservando memoria para d_sobelOutput\n");
        exit(-1);
    }

    //Algoritmo Paralelo con CUDA
    startGPU = clock();


    error = hipMemcpy(d_M,h_M,sizeM, hipMemcpyHostToDevice);
    if(error != hipSuccess){
       printf("Error copiando los datos de h_M a d_M  \n");
       exit(-1);
    }

    int blockSize = 32;
    dim3 dimBlock(blockSize,blockSize,1);
    dim3 dimGrid(ceil(width/float(blockSize)),ceil(height/float(blockSize)),1);

    hipDeviceSynchronize();

    error = hipMemcpy(d_dataRawImageB,splB,sizeGray, hipMemcpyHostToDevice);
    if(error != hipSuccess){
        printf("Error copiando los datos de splB a d_dataRawImage \n");
        exit(-1);
    }
    FilterColor<<<dimGrid,dimBlock>>>(d_M, d_dataRawImageB,width,height,MASK_WIDTH,d_sobelOutput,coef);
    hipMemcpy(h_imageOutputB,d_sobelOutput,sizeGray,hipMemcpyDeviceToHost);
    hipDeviceSynchronize();

    ///////////////////////////

    error = hipMemcpy(d_dataRawImageG,splG,sizeGray, hipMemcpyHostToDevice);
    if(error != hipSuccess){
        printf("Error copiando los datos de splG a d_dataRawImage \n");
        exit(-1);
    }


    FilterColor<<<dimGrid,dimBlock>>>(d_M,d_dataRawImageG,width,height,MASK_WIDTH,d_sobelOutput,coef);
    hipMemcpy(h_imageOutputG,d_sobelOutput,sizeGray,hipMemcpyDeviceToHost);

    hipDeviceSynchronize();

    /////////////////////////////

    error = hipMemcpy(d_dataRawImageR,splR,sizeGray, hipMemcpyHostToDevice);
    if(error != hipSuccess){
        printf("Error copiando los datos de splR a d_dataRawImage \n");
        exit(-1);
    }

    FilterColor<<<dimGrid,dimBlock>>>(d_M,d_dataRawImageR,width,height,MASK_WIDTH,d_sobelOutput,coef);
    hipMemcpy(h_imageOutputR,d_sobelOutput,sizeGray,hipMemcpyDeviceToHost);
    hipDeviceSynchronize();


    endGPU = clock();
    //fin algoritmo Paralelo con CUDA

    //imprimir tiempos de ejecucion
    gpu_time = ((double) (endGPU - startGPU)) / CLOCKS_PER_SEC;
    printf("Tiempo Algoritmo Paralelo CUDA: %.10f\n",gpu_time);

    //limpiar memoria
    hipFree(d_dataRawImageB);
    hipFree(d_dataRawImageG);
    hipFree(d_dataRawImageR);

    hipFree(d_M);
    hipFree(d_sobelOutput);

    return hipGetLastError();
}

	.text
	.file	"cuda_code.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	cuda_main                       # -- Begin function cuda_main
	.type	cuda_main,@function
cuda_main:                              # @cuda_main
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$1488, %rsp                     # imm = 0x5D0
	.cfi_def_cfa_offset 1520
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$_ZSt5wcout, %edi
	movl	$.L.str, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%rbx,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.1:                                # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movl	$.L.str.1, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%rbx,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.2:                                # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit5
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%rbx,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.3:                                # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit7
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	leaq	12(%rsp), %rdi
	callq	hipGetDeviceCount
	movl	$_ZSt5wcout, %edi
	movl	$.L.str.2, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%rbx,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.4:                                # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit9
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%rbx,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.5:                                # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit11
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	cmpl	$0, 12(%rsp)
	jle	.LBB0_21
# %bb.6:                                # %.lr.ph
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r14
.LBB0_7:                                # =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	hipGetDevicePropertiesR0600
	movl	$_ZSt5wcout, %edi
	movl	%ebx, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movl	$.L.str.3, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	$.L.str.3, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	376(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movl	$.L.str.4, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	380(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.8:                                # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit13
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movl	$_ZSt5wcout, %edi
	movl	$.L.str.5, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	304(%rsp), %rsi
	shrq	$20, %rsi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE9_M_insertImEERS2_T_
	movl	$.L.str.6, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.9:                                # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit15
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movl	$_ZSt5wcout, %edi
	movl	$.L.str.7, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	312(%rsp), %rsi
	shrq	$10, %rsi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE9_M_insertImEERS2_T_
	movl	$.L.str.8, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.10:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit17
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movl	$_ZSt5wcout, %edi
	movl	$.L.str.9, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	368(%rsp), %rsi
	shrq	$10, %rsi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE9_M_insertImEERS2_T_
	movl	$.L.str.8, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.11:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit19
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movl	$_ZSt5wcout, %edi
	movl	$.L.str.10, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	320(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.12:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit21
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.13:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit23
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movl	$_ZSt5wcout, %edi
	movl	$.L.str.11, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	404(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.14:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit25
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.15:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit27
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movl	$_ZSt5wcout, %edi
	movl	$.L.str.12, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	324(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.16:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit29
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movl	$_ZSt5wcout, %edi
	movl	$.L.str.13, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	336(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.17:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit31
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movl	$_ZSt5wcout, %edi
	movl	$.L.str.14, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	340(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movl	$.L.str.15, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	344(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movl	$.L.str.15, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	348(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movl	$.L.str.16, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.18:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit33
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movl	$_ZSt5wcout, %edi
	movl	$.L.str.17, %esi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	352(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movl	$.L.str.15, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	356(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movl	$.L.str.15, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movl	360(%rsp), %esi
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi
	movl	$.L.str.16, %esi
	movq	%rax, %rdi
	callq	_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKc
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	movq	240(%r15,%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.19:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit35
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	movq	_ZSt5wcout(%rip), %rax
	movq	-24(%rax), %rax
	movq	_ZSt5wcout+240(%rax), %rdi
	testq	%rdi, %rdi
	je	.LBB0_22
# %bb.20:                               # %_ZSt4endlIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_.exit37
                                        #   in Loop: Header=BB0_7 Depth=1
	movq	(%rdi), %rax
	movl	$10, %esi
	callq	*80(%rax)
	movl	$_ZSt5wcout, %edi
	movl	%eax, %esi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE3putEw
	movq	%rax, %rdi
	callq	_ZNSt13basic_ostreamIwSt11char_traitsIwEE5flushEv
	incl	%ebx
	cmpl	12(%rsp), %ebx
	jl	.LBB0_7
.LBB0_21:                               # %._crit_edge
	callq	hipGetLastError
	addq	$1488, %rsp                     # imm = 0x5D0
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB0_22:
	.cfi_def_cfa_offset 1520
	callq	_ZSt16__throw_bad_castv
.Lfunc_end0:
	.size	cuda_main, .Lfunc_end0-cuda_main
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__ConvolucionPcPhiijS0_ # -- Begin function _Z26__device_stub__ConvolucionPcPhiijS0_
	.type	_Z26__device_stub__ConvolucionPcPhiijS0_,@function
_Z26__device_stub__ConvolucionPcPhiijS0_: # @_Z26__device_stub__ConvolucionPcPhiijS0_
	.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	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	20(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	16(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	40(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%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	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%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	$_Z11ConvolucionPcPhiijS0_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	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	_Z26__device_stub__ConvolucionPcPhiijS0_, .Lfunc_end1-_Z26__device_stub__ConvolucionPcPhiijS0_
	.cfi_endproc
                                        # -- End function
	.globl	_Z23__device_stub__img2grayPhiiS_ # -- Begin function _Z23__device_stub__img2grayPhiiS_
	.type	_Z23__device_stub__img2grayPhiiS_,@function
_Z23__device_stub__img2grayPhiiS_:      # @_Z23__device_stub__img2grayPhiiS_
	.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	12(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	8(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%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	$_Z8img2grayPhiiS_, %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_end2:
	.size	_Z23__device_stub__img2grayPhiiS_, .Lfunc_end2-_Z23__device_stub__img2grayPhiiS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__FilterColorPcPhiijS0_f # -- Begin function _Z26__device_stub__FilterColorPcPhiijS0_f
	.type	_Z26__device_stub__FilterColorPcPhiijS0_f,@function
_Z26__device_stub__FilterColorPcPhiijS0_f: # @_Z26__device_stub__FilterColorPcPhiijS0_f
	.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	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	20(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	16(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	40(%rsp), %r8
	movq	%r9, (%r8)
	leaq	8(%rsp), %r9
	movss	%xmm0, (%r9)
	leaq	96(%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)
	movq	%r9, 48(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%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	$_Z11FilterColorPcPhiijS0_f, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	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	_Z26__device_stub__FilterColorPcPhiijS0_f, .Lfunc_end3-_Z26__device_stub__FilterColorPcPhiijS0_f
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z15convolucionCudaiiiiPhRS_iPc
.LCPI4_0:
	.long	0x3d000000                      # float 0.03125
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI4_1:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	_Z15convolucionCudaiiiiPhRS_iPc
	.type	_Z15convolucionCudaiiiiPhRS_iPc,@function
_Z15convolucionCudaiiiiPhRS_iPc:        # @_Z15convolucionCudaiiiiPhRS_iPc
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	.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, 48(%rsp)                   # 8-byte Spill
	movq	%r8, %rbx
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movl	%esi, %ebp
	movl	%edi, %r15d
	movl	112(%rsp), %eax
	imull	%eax, %eax
	movslq	%eax, %r14
	leaq	32(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_1
# %bb.3:
	movslq	%r13d, %r13
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_4
# %bb.5:
	movslq	%r12d, %r12
	leaq	16(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_6
# %bb.7:
	leaq	8(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_8
# %bb.9:
	callq	clock
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movq	24(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB4_10
# %bb.11:
	movq	120(%rsp), %rsi
	movq	32(%rsp), %rdi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB4_12
# %bb.13:
	cvtsi2ss	%r15d, %xmm0
	movabsq	$137438953504, %r14             # imm = 0x2000000020
	mulss	.LCPI4_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %r13
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ebp, %xmm0
	mulss	.LCPI4_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rbx
	movl	%r13d, %eax
	shlq	$32, %rbx
	orq	%rax, %rbx
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_15
# %bb.14:
	movq	24(%rsp), %rdi
	movq	16(%rsp), %rcx
	movl	%r15d, %esi
	movl	%ebp, %edx
	callq	_Z23__device_stub__img2grayPhiiS_
.LBB4_15:
	callq	hipDeviceSynchronize
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_17
# %bb.16:
	movq	32(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	8(%rsp), %r9
	movl	%r15d, %edx
	movl	%ebp, %ecx
	movl	112(%rsp), %r8d
	callq	_Z26__device_stub__ConvolucionPcPhiijS0_
.LBB4_17:
	movq	48(%rsp), %rax                  # 8-byte Reload
	movq	(%rax), %rdi
	movq	8(%rsp), %rsi
	movq	%r12, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	callq	clock
	subq	40(%rsp), %rax                  # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI4_1(%rip), %xmm0
	movl	$.L.str.24, %edi
	movb	$1, %al
	callq	printf
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	callq	hipGetLastError
	addq	$56, %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
.LBB4_1:
	.cfi_def_cfa_offset 112
	movl	$.Lstr.12, %edi
	jmp	.LBB4_2
.LBB4_4:
	movl	$.Lstr.11, %edi
	jmp	.LBB4_2
.LBB4_6:
	movl	$.Lstr.3, %edi
	jmp	.LBB4_2
.LBB4_8:
	movl	$.Lstr.10, %edi
	jmp	.LBB4_2
.LBB4_10:
	movl	$.Lstr.1, %edi
	jmp	.LBB4_2
.LBB4_12:
	movl	$.Lstr, %edi
.LBB4_2:
	callq	puts@PLT
	movl	$-1, %edi
	callq	exit
.Lfunc_end4:
	.size	_Z15convolucionCudaiiiiPhRS_iPc, .Lfunc_end4-_Z15convolucionCudaiiiiPhRS_iPc
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf
.LCPI5_0:
	.long	0x3d000000                      # float 0.03125
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI5_1:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf
	.type	_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf,@function
_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf: # @_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf
	.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	$88, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movss	%xmm0, 20(%rsp)                 # 4-byte Spill
	movq	%r9, %rbp
	movq	%r8, 80(%rsp)                   # 8-byte Spill
	movq	%rcx, %r12
	movl	%edx, %r15d
	movl	%esi, %ebx
	movl	%edi, %r14d
	movl	168(%rsp), %eax
	imull	%eax, %eax
	movslq	%eax, %r13
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB5_1
# %bb.3:
	movslq	%r15d, %r15
	leaq	48(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	leaq	40(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	leaq	32(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB5_4
# %bb.5:
	movq	%rbp, 72(%rsp)                  # 8-byte Spill
	leaq	8(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB5_6
# %bb.7:
	movq	176(%rsp), %rbp
	callq	clock
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movq	24(%rsp), %rdi
	movq	%rbp, %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB5_8
# %bb.9:
	cvtsi2ss	%r14d, %xmm0
	mulss	.LCPI5_0(%rip), %xmm0
	callq	ceilf@PLT
	movss	%xmm0, 60(%rsp)                 # 4-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ebx, %xmm0
	mulss	.LCPI5_0(%rip), %xmm0
	callq	ceilf@PLT
	movss	%xmm0, 56(%rsp)                 # 4-byte Spill
	callq	hipDeviceSynchronize
	movq	48(%rsp), %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB5_10
# %bb.11:
	movq	144(%rsp), %rbp
	cvttss2si	60(%rsp), %rax          # 4-byte Folded Reload
	cvttss2si	56(%rsp), %r12          # 4-byte Folded Reload
	movl	%eax, %eax
	shlq	$32, %r12
	orq	%rax, %r12
	movabsq	$137438953504, %r13             # imm = 0x2000000020
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_13
# %bb.12:
	movq	24(%rsp), %rdi
	movq	48(%rsp), %rsi
	movq	8(%rsp), %r9
	movl	%r14d, %edx
	movl	%ebx, %ecx
	movl	168(%rsp), %r8d
	movss	20(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	callq	_Z26__device_stub__FilterColorPcPhiijS0_f
.LBB5_13:
	movq	(%rbp), %rdi
	movq	8(%rsp), %rsi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	callq	hipDeviceSynchronize
	movq	40(%rsp), %rdi
	movq	80(%rsp), %rsi                  # 8-byte Reload
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB5_14
# %bb.15:
	movq	152(%rsp), %rbp
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_17
# %bb.16:
	movq	24(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	8(%rsp), %r9
	movl	%r14d, %edx
	movl	%ebx, %ecx
	movl	168(%rsp), %r8d
	movss	20(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	callq	_Z26__device_stub__FilterColorPcPhiijS0_f
.LBB5_17:
	movq	(%rbp), %rdi
	movq	8(%rsp), %rsi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	callq	hipDeviceSynchronize
	movq	32(%rsp), %rdi
	movq	72(%rsp), %rsi                  # 8-byte Reload
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB5_18
# %bb.19:
	movq	160(%rsp), %rbp
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_21
# %bb.20:
	movq	24(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	8(%rsp), %r9
	movl	%r14d, %edx
	movl	%ebx, %ecx
	movl	168(%rsp), %r8d
	movss	20(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	callq	_Z26__device_stub__FilterColorPcPhiijS0_f
.LBB5_21:
	movq	(%rbp), %rdi
	movq	8(%rsp), %rsi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	callq	hipDeviceSynchronize
	callq	clock
	subq	64(%rsp), %rax                  # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI5_1(%rip), %xmm0
	movl	$.L.str.24, %edi
	movb	$1, %al
	callq	printf
	movq	48(%rsp), %rdi
	callq	hipFree
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	callq	hipGetLastError
	addq	$88, %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
.LBB5_1:
	.cfi_def_cfa_offset 144
	movl	$.Lstr.12, %edi
	jmp	.LBB5_2
.LBB5_4:
	movl	$.Lstr.11, %edi
	jmp	.LBB5_2
.LBB5_6:
	movl	$.Lstr.10, %edi
	jmp	.LBB5_2
.LBB5_8:
	movl	$.Lstr.9, %edi
	jmp	.LBB5_2
.LBB5_10:
	movl	$.Lstr.8, %edi
	jmp	.LBB5_2
.LBB5_14:
	movl	$.Lstr.7, %edi
	jmp	.LBB5_2
.LBB5_18:
	movl	$.Lstr.6, %edi
.LBB5_2:
	callq	puts@PLT
	movl	$-1, %edi
	callq	exit
.Lfunc_end5:
	.size	_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf, .Lfunc_end5-_Z20convolucionCudaColoriiiPhS_S_RS_S0_S0_iPcf
	.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	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z11ConvolucionPcPhiijS0_, %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	$_Z8img2grayPhiiS_, %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	$_Z11FilterColorPcPhiijS0_f, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__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	.LBB7_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
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"NBody.GPU"
	.size	.L.str, 10

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"========="
	.size	.L.str.1, 10

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Dispositivo CUDA : "
	.size	.L.str.2, 20

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"."
	.size	.L.str.4, 2

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Memoria global:   "
	.size	.L.str.5, 19

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"mb"
	.size	.L.str.6, 3

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Memoria compartida:   "
	.size	.L.str.7, 23

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

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Memoria constante: "
	.size	.L.str.9, 20

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Registros por bloque: "
	.size	.L.str.10, 23

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Multi Processor Count: "
	.size	.L.str.11, 24

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Tamano Warp :         "
	.size	.L.str.12, 23

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Threads por block: "
	.size	.L.str.13, 20

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Dimension Max block : [ "
	.size	.L.str.14, 25

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	", "
	.size	.L.str.15, 3

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	" ]"
	.size	.L.str.16, 3

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"Dimension Max grid :  [ "
	.size	.L.str.17, 25

	.type	_Z11ConvolucionPcPhiijS0_,@object # @_Z11ConvolucionPcPhiijS0_
	.section	.rodata,"a",@progbits
	.globl	_Z11ConvolucionPcPhiijS0_
	.p2align	3, 0x0
_Z11ConvolucionPcPhiijS0_:
	.quad	_Z26__device_stub__ConvolucionPcPhiijS0_
	.size	_Z11ConvolucionPcPhiijS0_, 8

	.type	_Z8img2grayPhiiS_,@object       # @_Z8img2grayPhiiS_
	.globl	_Z8img2grayPhiiS_
	.p2align	3, 0x0
_Z8img2grayPhiiS_:
	.quad	_Z23__device_stub__img2grayPhiiS_
	.size	_Z8img2grayPhiiS_, 8

	.type	_Z11FilterColorPcPhiijS0_f,@object # @_Z11FilterColorPcPhiijS0_f
	.globl	_Z11FilterColorPcPhiijS0_f
	.p2align	3, 0x0
_Z11FilterColorPcPhiijS0_f:
	.quad	_Z26__device_stub__FilterColorPcPhiijS0_f
	.size	_Z11FilterColorPcPhiijS0_f, 8

	.type	.L.str.24,@object               # @.str.24
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.24:
	.asciz	"Tiempo Algoritmo Paralelo CUDA: %.10f\n"
	.size	.L.str.24, 39

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z11ConvolucionPcPhiijS0_"
	.size	.L__unnamed_1, 26

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z8img2grayPhiiS_"
	.size	.L__unnamed_2, 18

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z11FilterColorPcPhiijS0_f"
	.size	.L__unnamed_3, 27

	.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	"Error copiando los datos de h_M a d_M "
	.size	.Lstr, 39

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Error copiando los datos de dataRawImage a d_dataRawImage "
	.size	.Lstr.1, 59

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Error reservando memoria para d_imageOutput"
	.size	.Lstr.3, 44

	.type	.Lstr.6,@object                 # @str.6
.Lstr.6:
	.asciz	"Error copiando los datos de splR a d_dataRawImage "
	.size	.Lstr.6, 51

	.type	.Lstr.7,@object                 # @str.7
.Lstr.7:
	.asciz	"Error copiando los datos de splG a d_dataRawImage "
	.size	.Lstr.7, 51

	.type	.Lstr.8,@object                 # @str.8
.Lstr.8:
	.asciz	"Error copiando los datos de splB a d_dataRawImage "
	.size	.Lstr.8, 51

	.type	.Lstr.9,@object                 # @str.9
.Lstr.9:
	.asciz	"Error copiando los datos de h_M a d_M  "
	.size	.Lstr.9, 40

	.type	.Lstr.10,@object                # @str.10
.Lstr.10:
	.asciz	"Error reservando memoria para d_sobelOutput"
	.size	.Lstr.10, 44

	.type	.Lstr.11,@object                # @str.11
.Lstr.11:
	.asciz	"Error reservando memoria para d_dataRawImage"
	.size	.Lstr.11, 45

	.type	.Lstr.12,@object                # @str.12
.Lstr.12:
	.asciz	"Error reservando memoria para d_M"
	.size	.Lstr.12, 34

	.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 _Z26__device_stub__ConvolucionPcPhiijS0_
	.addrsig_sym _Z23__device_stub__img2grayPhiiS_
	.addrsig_sym _Z26__device_stub__FilterColorPcPhiijS0_f
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _ZSt5wcout
	.addrsig_sym _Z11ConvolucionPcPhiijS0_
	.addrsig_sym _Z8img2grayPhiiS_
	.addrsig_sym _Z11FilterColorPcPhiijS0_f
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z11ConvolucionPcPhiijS0_ ; -- Begin function _Z11ConvolucionPcPhiijS0_
	.globl	_Z11ConvolucionPcPhiijS0_
	.p2align	8
	.type	_Z11ConvolucionPcPhiijS0_,@function
_Z11ConvolucionPcPhiijS0_:              ; @_Z11ConvolucionPcPhiijS0_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b128 s[4:7], s[0:1], 0x10
	v_bfe_u32 v2, v0, 10, 10
	v_and_b32_e32 v3, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1)
	v_mad_u64_u32 v[0:1], null, s15, s3, v[2:3]
	v_mad_u64_u32 v[1:2], null, s14, s2, v[3:4]
	v_mov_b32_e32 v2, 0
	s_cmp_eq_u32 s6, 0
	s_mov_b32 s3, 0
	s_cbranch_scc1 .LBB0_7
; %bb.1:                                ; %.preheader.preheader
	s_load_b128 s[8:11], s[0:1], 0x0
	s_lshr_b32 s2, s6, 1
	v_mov_b32_e32 v2, 0
	v_subrev_nc_u32_e32 v3, s2, v0
	v_subrev_nc_u32_e32 v5, s2, v1
	s_mov_b32 s7, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_mul_lo_u32 v4, s4, v3
.LBB0_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	v_add_nc_u32_e32 v6, s7, v3
	s_mov_b32 s12, s3
	s_mov_b32 s14, s6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, 0, v6
	v_cmp_le_i32_e64 s2, s5, v6
	v_mov_b32_e32 v6, v5
	s_or_b32 s13, vcc_lo, s2
.LBB0_3:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e32 vcc_lo, 0, v6
	v_cmp_le_i32_e64 s2, s4, v6
	s_or_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s2, s2, s13
	s_xor_b32 s15, s2, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s2, s15
	s_cbranch_execz .LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
	v_add_nc_u32_e32 v7, v4, v6
	v_mov_b32_e32 v9, s12
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v8, 31, v7
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v7, vcc_lo, s10, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s11, v8, vcc_lo
	global_load_u8 v7, v[7:8], off
	global_load_i8 v8, v9, s[8:9]
	s_waitcnt vmcnt(0)
	v_mad_i32_i24 v2, v8, v7, v2
.LBB0_5:                                ;   in Loop: Header=BB0_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s2
	v_add_nc_u32_e32 v6, 1, v6
	s_add_i32 s14, s14, -1
	s_add_i32 s12, s12, 1
	s_cmp_eq_u32 s14, 0
	s_cbranch_scc0 .LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v4, s4, v4
	s_add_i32 s7, s7, 1
	s_add_i32 s3, s3, s6
	s_cmp_eq_u32 s7, s6
	s_cbranch_scc0 .LBB0_2
.LBB0_7:                                ; %._crit_edge
	s_load_b64 s[0:1], s[0:1], 0x20
	s_delay_alu instid0(VALU_DEP_2)
	v_mad_u64_u32 v[3:4], null, v0, s4, v[1:2]
	v_med3_i32 v0, v2, 0, 0xff
	s_waitcnt lgkmcnt(0)
	global_store_b8 v3, v0, s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11ConvolucionPcPhiijS0_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.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 10
		.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	_Z11ConvolucionPcPhiijS0_, .Lfunc_end0-_Z11ConvolucionPcPhiijS0_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 368
; NumSgprs: 18
; NumVgprs: 10
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 10
; 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	_Z8img2grayPhiiS_       ; -- Begin function _Z8img2grayPhiiS_
	.globl	_Z8img2grayPhiiS_
	.p2align	8
	.type	_Z8img2grayPhiiS_,@function
_Z8img2grayPhiiS_:                      ; @_Z8img2grayPhiiS_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b64 s[4:5], s[0:1], 0x8
	v_bfe_u32 v2, v0, 10, 10
	v_and_b32_e32 v3, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[0:1], null, s15, s3, v[2:3]
	v_mad_u64_u32 v[1:2], null, s14, s2, v[3:4]
	v_cmp_gt_i32_e32 vcc_lo, s5, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e64 s2, s4, v1
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB1_2
; %bb.1:
	s_load_b64 s[2:3], s[0:1], 0x0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, v0, s4, v[1:2]
	s_load_b64 s[0:1], s[0:1], 0x10
	v_lshl_add_u32 v0, v2, 1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v1, 31, v0
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s2, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	s_mov_b32 s2, 0x39581062
	s_mov_b32 s3, 0x3fe2c8b4
	s_clause 0x1
	global_load_u16 v5, v[0:1], off
	global_load_u8 v3, v[0:1], off offset:2
	s_waitcnt vmcnt(1)
	v_bfe_u32 v0, v5, 8, 8
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[3:4], v3
	v_and_b32_e32 v5, 0xff, v5
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f64_u32_e32 v[0:1], v0
	v_and_b32_e32 v5, 0xffff, v5
	s_delay_alu instid0(VALU_DEP_2)
	v_mul_f64 v[0:1], v[0:1], s[2:3]
	s_mov_b32 s2, 0xe5604189
	s_mov_b32 s3, 0x3fd322d0
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[0:1], v[3:4], s[2:3], v[0:1]
	v_cvt_f64_u32_e32 v[3:4], v5
	s_mov_b32 s2, 0x9fbe76c9
	s_mov_b32 s3, 0x3fbd2f1a
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[0:1], v[3:4], s[2:3], v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_cvt_i32_f64_e32 v3, v[0:1]
	v_ashrrev_i32_e32 v1, 31, v2
	v_add_co_u32 v0, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b8 v[0:1], v3, off
.LBB1_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8img2grayPhiiS_
		.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 6
		.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	_Z8img2grayPhiiS_, .Lfunc_end1-_Z8img2grayPhiiS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 360
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; 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	_Z11FilterColorPcPhiijS0_f ; -- Begin function _Z11FilterColorPcPhiijS0_f
	.globl	_Z11FilterColorPcPhiijS0_f
	.p2align	8
	.type	_Z11FilterColorPcPhiijS0_f,@function
_Z11FilterColorPcPhiijS0_f:             ; @_Z11FilterColorPcPhiijS0_f
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b128 s[4:7], s[0:1], 0x10
	v_bfe_u32 v2, v0, 10, 10
	v_and_b32_e32 v3, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1)
	v_mad_u64_u32 v[0:1], null, s15, s3, v[2:3]
	v_mad_u64_u32 v[1:2], null, s14, s2, v[3:4]
	v_mov_b32_e32 v2, 0
	s_cmp_eq_u32 s6, 0
	s_mov_b32 s3, 0
	s_cbranch_scc1 .LBB2_7
; %bb.1:                                ; %.preheader.preheader
	s_clause 0x1
	s_load_b128 s[8:11], s[0:1], 0x0
	s_load_b32 s7, s[0:1], 0x28
	s_lshr_b32 s2, s6, 1
	v_mov_b32_e32 v2, 0
	v_subrev_nc_u32_e32 v3, s2, v0
	v_subrev_nc_u32_e32 v5, s2, v1
	s_mov_b32 s12, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_mul_lo_u32 v4, s4, v3
.LBB2_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB2_3 Depth 2
	v_add_nc_u32_e32 v6, s12, v3
	s_mov_b32 s13, s3
	s_mov_b32 s15, s6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, 0, v6
	v_cmp_le_i32_e64 s2, s5, v6
	v_mov_b32_e32 v6, v5
	s_or_b32 s14, vcc_lo, s2
.LBB2_3:                                ;   Parent Loop BB2_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e32 vcc_lo, 0, v6
	v_cmp_le_i32_e64 s2, s4, v6
	s_or_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s2, s2, s14
	s_xor_b32 s16, s2, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s2, s16
	s_cbranch_execz .LBB2_5
; %bb.4:                                ;   in Loop: Header=BB2_3 Depth=2
	v_add_nc_u32_e32 v7, v4, v6
	v_cvt_f32_i32_e32 v2, v2
	v_mov_b32_e32 v9, s13
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v8, 31, v7
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v7, vcc_lo, s10, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s11, v8, vcc_lo
	global_load_i8 v9, v9, s[8:9]
	global_load_u8 v7, v[7:8], off
	s_waitcnt vmcnt(0)
	v_mul_i32_i24_e32 v7, v9, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f32_i32_e32 v7, v7
	v_fmac_f32_e32 v2, s7, v7
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_i32_f32_e32 v2, v2
.LBB2_5:                                ;   in Loop: Header=BB2_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s2
	v_add_nc_u32_e32 v6, 1, v6
	s_add_i32 s15, s15, -1
	s_add_i32 s13, s13, 1
	s_cmp_eq_u32 s15, 0
	s_cbranch_scc0 .LBB2_3
; %bb.6:                                ;   in Loop: Header=BB2_2 Depth=1
	v_add_nc_u32_e32 v4, s4, v4
	s_add_i32 s12, s12, 1
	s_add_i32 s3, s3, s6
	s_cmp_eq_u32 s12, s6
	s_cbranch_scc0 .LBB2_2
.LBB2_7:                                ; %._crit_edge
	s_load_b64 s[0:1], s[0:1], 0x20
	s_delay_alu instid0(VALU_DEP_2)
	v_mad_u64_u32 v[3:4], null, v0, s4, v[1:2]
	v_med3_i32 v0, v2, 0, 0xff
	s_waitcnt lgkmcnt(0)
	global_store_b8 v3, v0, s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11FilterColorPcPhiijS0_f
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 10
		.amdhsa_next_free_sgpr 17
		.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	_Z11FilterColorPcPhiijS0_f, .Lfunc_end2-_Z11FilterColorPcPhiijS0_f
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 400
; NumSgprs: 19
; NumVgprs: 10
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 19
; NumVGPRsForWavesPerEU: 10
; 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
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.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 __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:     by_value
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11ConvolucionPcPhiijS0_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11ConvolucionPcPhiijS0_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     10
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z8img2grayPhiiS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z8img2grayPhiiS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .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
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11FilterColorPcPhiijS0_f
    .private_segment_fixed_size: 0
    .sgpr_count:     19
    .sgpr_spill_count: 0
    .symbol:         _Z11FilterColorPcPhiijS0_f.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     10
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
