#include <iostream>
#include <cuda.h>
#include <cuda_runtime.h>

#include <stdio.h>
#include <cmath>


typedef unsigned int histogram_t;
typedef unsigned vector_t;

#define MIL 1000
#define MILLON MIL*MIL
#define N 80*MILLON
#define M 8                         //Tamaño histograma
#define TPB 1024                    //Threadsperblock
#define P (N+TPB-1)/TPB             //Nº sub-histogramas
#define R 106                       //Repeticiones para medir tiempo

#define SIZEH M*P*sizeof(histogram_t)
#define SIZEV N*sizeof(vector_t)

static void CheckCudaErrorAux (const char *file, unsigned line, const char *statement, cudaError_t err)
{
	if (err == cudaSuccess)
		return;
	std::cerr << statement<<" returned " << cudaGetErrorString(err) << "("<<err<< ") at "<<file<<":"<<line << std::endl;
	exit (1);
}

static void CheckCudaErrorAux (const char *, unsigned, const char *, cudaError_t);
#define CUDA_CHECK_RETURN(value) CheckCudaErrorAux(__FILE__,__LINE__, #value, value)

__global__ void inicializar_histograma(histogram_t * h, size_t n){
  size_t thread_id = threadIdx.x + blockDim.x * blockIdx.x;
  if(thread_id < n) h[thread_id] = 0;
}

// Este kernel se llama con 1 histograma local por cada bloque, con N hilos.
__global__ void histograma_barrera(histogram_t * h, vector_t * v, 
    size_t m, size_t n){
  //Inicialización del histograma local
  size_t thread_id = threadIdx.x + blockIdx.x*blockDim.x;
  if(thread_id < n){ 
    __shared__ histogram_t smem [M];
    if(threadIdx.x < M) smem[threadIdx.x] = 0;
    __syncthreads();

    size_t h_pos = v[thread_id]%m;
    atomicAdd(&smem[h_pos], 1);
    __syncthreads();

    if(threadIdx.x < M)
      h[blockIdx.x*M + threadIdx.x] = smem[threadIdx.x];
  }
}

__global__ void reduccion_atomic(histogram_t * h, size_t m, size_t p){
  size_t thread_id = threadIdx.x + blockDim.x * blockIdx.x;
  if(thread_id >= m*p || thread_id < m) return;
  atomicAdd(&h[thread_id%m], h[thread_id]);
}

//Hay un hilo por cada dos posiciones del histograma m*(p/2)
__global__ void reduccion_paralela(histogram_t * h, size_t m, size_t p){
  size_t thread_id = threadIdx.x + blockDim.x * blockIdx.x;
  if(thread_id >= m*(p/2)) return;
  h[thread_id] += h[thread_id + m*(p/2)];
  if((p%2) && thread_id < m)
    h[thread_id] += h[thread_id + 2*m*(p/2)];
}

float tiempo_kernel(histogram_t * h, vector_t * v, unsigned kernel);

void print_vector (histogram_t * h, size_t n);
void print_vector_device (histogram_t * h, size_t n);
int main (void){
  vector_t * v = (vector_t*)malloc(SIZEV);
  for(int i = 0; i < N; i++) v[i] = rand();
  vector_t * v_device;
  CUDA_CHECK_RETURN(cudaMalloc(&v_device, SIZEV));
  CUDA_CHECK_RETURN(cudaMemcpy(v_device, v, SIZEV, cudaMemcpyHostToDevice));

  histogram_t * h = (histogram_t*)malloc(SIZEH);
  histogram_t * h_device;
  CUDA_CHECK_RETURN(cudaMalloc(&h_device, SIZEH));

  printf("Llamando kernel con M = %i N = %i y P = %i\n", M, N, P);

  float elapsedTime = tiempo_kernel(h_device, v_device, 1);

  printf("Tiempo transcurrido: %f ms\n", elapsedTime);

  CUDA_CHECK_RETURN(cudaMemcpy(h, h_device, SIZEH, cudaMemcpyDeviceToHost));

  long long unsigned n_resultado = 0;
  for(int i = 0; i < M; i++){
    n_resultado+=h[i];
  }
  printf("Suma de elementos del histogr.: %llu\n", n_resultado);
  printf("Numero de elementos del vector: %i\n", N);

  free(v);
  cudaFree(v_device);
  free(h);
  cudaFree(h_device);
}

float tiempo_kernel(histogram_t * h, vector_t * v, unsigned kernel = 1){
  size_t threadsPerBlock = 1024;
  size_t blocksPerGridM = ((unsigned)M + threadsPerBlock - 1) / threadsPerBlock;
  size_t blocksPerGridN = ((unsigned)N + threadsPerBlock - 1) / threadsPerBlock;
  size_t blocksPerGridPM = ((unsigned)(P*M) + threadsPerBlock - 1) / threadsPerBlock;
  size_t blocksReduccion;
  
  cudaEvent_t start,stop, reduccion;
  cudaEventCreate(&start);
  cudaEventCreate(&reduccion);
  cudaEventCreate(&stop);
  float totalTime = 0, totalCalculo = 0, totalReduccion = 0;

  for(int i = 0; i < R; i++){
    size_t p = P;
    cudaEventRecord(start, 0);
    histograma_barrera <<<blocksPerGridN, threadsPerBlock>>>(h, v, M, N);
    cudaEventRecord(reduccion, 0);
    reduccion_atomic<<<blocksPerGridPM, threadsPerBlock>>>(h, M, p);
    cudaEventRecord(stop, 0);
    cudaEventSynchronize(stop);

    float elapsedTime;
    cudaEventElapsedTime(&elapsedTime, start, stop);
    if(i > 5) totalTime += elapsedTime;
    cudaEventElapsedTime(&elapsedTime, start, reduccion);
    if(i > 5) totalCalculo += elapsedTime;
    cudaEventElapsedTime(&elapsedTime, reduccion, stop);
    if(i > 5) totalReduccion += elapsedTime;
  }
  printf("Tiempo de calculo %f ms ; tiempo reduccion %f ms \n ", totalCalculo/(R-6),totalReduccion/(R-6));

  return totalTime / (R-6);
}

void print_vector (histogram_t * h, size_t n){
  printf("n=%llu ", n);
  unsigned suma = 0;
  for(int i = 0; i < n; i++){
    suma += h[i];
    printf("%i ", h[i]);
  }
  printf("\nSuma: %u\n", suma);
}
void print_vector_device (histogram_t * h, size_t n){
  histogram_t * h_host = (histogram_t*)malloc(SIZEH);
  CUDA_CHECK_RETURN(cudaMemcpy(h_host, h, SIZEH, cudaMemcpyDeviceToHost)); 
  print_vector(h_host, n);
  free(h_host);
}

	.file	"tmpxft_0032b4ec_00000000-6_main.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3642:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3642:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" returned "
.LC1:
	.string	"("
.LC2:
	.string	") at "
.LC3:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/mbdaso/cuda/master/histograma-reduccion-barrera/main.cu"
.LC4:
	.string	":"
	.text
	.type	_ZL17CheckCudaErrorAuxPKcjS0_9cudaError.constprop.0, @function
_ZL17CheckCudaErrorAuxPKcjS0_9cudaError.constprop.0:
.LFB4305:
	.cfi_startproc
	testl	%edx, %edx
	je	.L4
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%edi, %ebx
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %edi
	movq	%rax, %r12
	call	cudaGetErrorString@PLT
	movq	%r12, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %esi
	movq	%rax, %rdi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movl	$1, %edi
	call	exit@PLT
.L4:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	ret
	.cfi_endproc
.LFE4305:
	.size	_ZL17CheckCudaErrorAuxPKcjS0_9cudaError.constprop.0, .-_ZL17CheckCudaErrorAuxPKcjS0_9cudaError.constprop.0
	.section	.rodata.str1.1
.LC5:
	.string	"n=%llu "
.LC6:
	.string	"%i "
.LC7:
	.string	"\nSuma: %u\n"
	.text
	.globl	_Z12print_vectorPjm
	.type	_Z12print_vectorPjm, @function
_Z12print_vectorPjm:
.LFB3638:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rsi, %rdx
	xorl	%eax, %eax
	leaq	.LC6(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdi, %r13
	movl	$2, %edi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	leaq	.LC5(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	call	__printf_chk@PLT
.L10:
	cmpq	%rbx, %rbp
	je	.L13
	movl	0(%r13,%rbx,4), %edx
	movq	%r14, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbx
	addl	%edx, %r12d
	call	__printf_chk@PLT
	jmp	.L10
.L13:
	popq	%rbx
	.cfi_def_cfa_offset 40
	movl	%r12d, %edx
	popq	%rbp
	.cfi_def_cfa_offset 32
	movl	$2, %edi
	popq	%r12
	.cfi_def_cfa_offset 24
	leaq	.LC7(%rip), %rsi
	popq	%r13
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE3638:
	.size	_Z12print_vectorPjm, .-_Z12print_vectorPjm
	.section	.rodata.str1.1
.LC8:
	.string	"cudaMemcpy(h_host, h, SIZEH, cudaMemcpyDeviceToHost)"
	.text
	.globl	_Z19print_vector_devicePjm
	.type	_Z19print_vector_devicePjm, @function
_Z19print_vector_devicePjm:
.LFB3639:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdi, %r12
	movl	$2500028, %edi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	malloc@PLT
	movl	$2, %ecx
	movq	%r12, %rsi
	movl	$2500028, %edx
	movq	%rax, %rdi
	movq	%rax, %rbx
	call	cudaMemcpy@PLT
	leaq	.LC8(%rip), %rsi
	movl	$155, %edi
	movl	%eax, %edx
	call	_ZL17CheckCudaErrorAuxPKcjS0_9cudaError.constprop.0
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	call	_Z12print_vectorPjm
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE3639:
	.size	_Z19print_vector_devicePjm, .-_Z19print_vector_devicePjm
	.globl	_Z43__device_stub__Z22inicializar_histogramaPjmPjm
	.type	_Z43__device_stub__Z22inicializar_histogramaPjmPjm, @function
_Z43__device_stub__Z22inicializar_histogramaPjmPjm:
.LFB3664:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z22inicializar_histogramaPjm(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L16:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3664:
	.size	_Z43__device_stub__Z22inicializar_histogramaPjmPjm, .-_Z43__device_stub__Z22inicializar_histogramaPjmPjm
	.globl	_Z22inicializar_histogramaPjm
	.type	_Z22inicializar_histogramaPjm, @function
_Z22inicializar_histogramaPjm:
.LFB3665:
	.cfi_startproc
	endbr64
	jmp	_Z43__device_stub__Z22inicializar_histogramaPjmPjm
	.cfi_endproc
.LFE3665:
	.size	_Z22inicializar_histogramaPjm, .-_Z22inicializar_histogramaPjm
	.globl	_Z42__device_stub__Z18histograma_barreraPjS_mmPjS_mm
	.type	_Z42__device_stub__Z18histograma_barreraPjS_mmPjS_mm, @function
_Z42__device_stub__Z18histograma_barreraPjS_mmPjS_mm:
.LFB3666:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%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	.L21
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z18histograma_barreraPjS_mm(%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
.L21:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3666:
	.size	_Z42__device_stub__Z18histograma_barreraPjS_mmPjS_mm, .-_Z42__device_stub__Z18histograma_barreraPjS_mmPjS_mm
	.globl	_Z18histograma_barreraPjS_mm
	.type	_Z18histograma_barreraPjS_mm, @function
_Z18histograma_barreraPjS_mm:
.LFB3667:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z18histograma_barreraPjS_mmPjS_mm
	.cfi_endproc
.LFE3667:
	.size	_Z18histograma_barreraPjS_mm, .-_Z18histograma_barreraPjS_mm
	.globl	_Z38__device_stub__Z16reduccion_atomicPjmmPjmm
	.type	_Z38__device_stub__Z16reduccion_atomicPjmmPjmm, @function
_Z38__device_stub__Z16reduccion_atomicPjmmPjmm:
.LFB3668:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z16reduccion_atomicPjmm(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L26:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3668:
	.size	_Z38__device_stub__Z16reduccion_atomicPjmmPjmm, .-_Z38__device_stub__Z16reduccion_atomicPjmmPjmm
	.globl	_Z16reduccion_atomicPjmm
	.type	_Z16reduccion_atomicPjmm, @function
_Z16reduccion_atomicPjmm:
.LFB3669:
	.cfi_startproc
	endbr64
	jmp	_Z38__device_stub__Z16reduccion_atomicPjmmPjmm
	.cfi_endproc
.LFE3669:
	.size	_Z16reduccion_atomicPjmm, .-_Z16reduccion_atomicPjmm
	.section	.rodata.str1.1
.LC11:
	.string	"Tiempo de calculo %f ms ; tiempo reduccion %f ms \n "
	.text
	.globl	_Z13tiempo_kernelPjS_j
	.type	_Z13tiempo_kernelPjS_j, @function
_Z13tiempo_kernelPjS_j:
.LFB3637:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movabsq	$4294968320, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	40(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	32(%rsp), %rdi
	call	cudaEventCreate@PLT
	movl	$0x00000000, 12(%rsp)
	movl	$0x00000000, 8(%rsp)
.L37:
	movq	24(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r12, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4295045421, %rdi
	movq	%r12, 60(%rsp)
	movl	$1, 68(%rsp)
	movq	%rdi, 48(%rsp)
	movl	$1, 56(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L32
	movl	$80000000, %ecx
	movl	$8, %edx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	call	_Z42__device_stub__Z18histograma_barreraPjS_mmPjS_mm
.L32:
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r12, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967907, %rdi
	movq	%r12, 60(%rsp)
	movl	$1, 68(%rsp)
	movq	%rdi, 48(%rsp)
	movl	$1, 56(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L33
	movl	$78125, %edx
	movl	$8, %esi
	movq	%rbp, %rdi
	call	_Z38__device_stub__Z16reduccion_atomicPjmmPjmm
.L33:
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	leaq	60(%rsp), %r14
	call	cudaEventRecord@PLT
	movq	32(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	cmpl	$5, %ebx
	jle	.L34
	movd	%r15d, %xmm2
	addss	60(%rsp), %xmm2
	movd	%xmm2, %r15d
.L34:
	movq	40(%rsp), %rdx
	movq	24(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	cmpl	$5, %ebx
	jle	.L35
	movss	8(%rsp), %xmm3
	addss	60(%rsp), %xmm3
	movss	%xmm3, 8(%rsp)
.L35:
	movq	32(%rsp), %rdx
	movq	40(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	cmpl	$5, %ebx
	jle	.L36
	movss	12(%rsp), %xmm4
	addss	60(%rsp), %xmm4
	movss	%xmm4, 12(%rsp)
.L36:
	incl	%ebx
	cmpl	$106, %ebx
	jne	.L37
	leaq	.LC11(%rip), %rsi
	movl	$2, %edi
	movb	$2, %al
	movss	12(%rsp), %xmm1
	movss	8(%rsp), %xmm0
	divss	.LC10(%rip), %xmm1
	divss	.LC10(%rip), %xmm0
	cvtss2sd	%xmm1, %xmm1
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	movd	%r15d, %xmm0
	divss	.LC10(%rip), %xmm0
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	addq	$88, %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
.LFE3637:
	.size	_Z13tiempo_kernelPjS_j, .-_Z13tiempo_kernelPjS_j
	.section	.rodata.str1.1
.LC12:
	.string	"cudaMalloc(&v_device, SIZEV)"
.LC13:
	.string	"cudaMemcpy(v_device, v, SIZEV, cudaMemcpyHostToDevice)"
.LC14:
	.string	"cudaMalloc(&h_device, SIZEH)"
.LC15:
	.string	"Llamando kernel con M = %i N = %i y P = %i\n"
.LC16:
	.string	"Tiempo transcurrido: %f ms\n"
.LC17:
	.string	"cudaMemcpy(h, h_device, SIZEH, cudaMemcpyDeviceToHost)"
.LC18:
	.string	"Suma de elementos del histogr.: %llu\n"
.LC19:
	.string	"Numero de elementos del vector: %i\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3636:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	$320000000, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	movq	%rax, %rbp
.L42:
	call	rand@PLT
	movl	%eax, 0(%rbp,%rbx,4)
	incq	%rbx
	cmpq	$80000000, %rbx
	jne	.L42
	leaq	8(%rsp), %rdi
	movl	$320000000, %esi
	call	cudaMalloc@PLT
	leaq	.LC12(%rip), %rsi
	movl	$81, %edi
	movl	%eax, %edx
	call	_ZL17CheckCudaErrorAuxPKcjS0_9cudaError.constprop.0
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbp, %rsi
	movl	$320000000, %edx
	call	cudaMemcpy@PLT
	leaq	.LC13(%rip), %rsi
	movl	$82, %edi
	movl	%eax, %edx
	call	_ZL17CheckCudaErrorAuxPKcjS0_9cudaError.constprop.0
	movl	$2500028, %edi
	call	malloc@PLT
	leaq	16(%rsp), %rdi
	movl	$2500028, %esi
	movq	%rax, %rbx
	call	cudaMalloc@PLT
	leaq	.LC14(%rip), %rsi
	movl	$86, %edi
	movl	%eax, %edx
	call	_ZL17CheckCudaErrorAuxPKcjS0_9cudaError.constprop.0
	movl	$78125, %r8d
	xorl	%eax, %eax
	movl	$80000000, %ecx
	movl	$8, %edx
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	$1, %edx
	call	_Z13tiempo_kernelPjS_j
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	movq	16(%rsp), %rsi
	movq	%rbx, %rdi
	movl	$2, %ecx
	movl	$2500028, %edx
	call	cudaMemcpy@PLT
	leaq	.LC17(%rip), %rsi
	movl	$94, %edi
	movl	%eax, %edx
	call	_ZL17CheckCudaErrorAuxPKcjS0_9cudaError.constprop.0
	xorl	%eax, %eax
	xorl	%edx, %edx
.L43:
	movl	(%rbx,%rax,4), %ecx
	incq	%rax
	addq	%rcx, %rdx
	cmpq	$8, %rax
	jne	.L43
	leaq	.LC18(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$80000000, %edx
	leaq	.LC19(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	addq	$40, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3636:
	.size	main, .-main
	.text
	.globl	_Z40__device_stub__Z18reduccion_paralelaPjmmPjmm
	.type	_Z40__device_stub__Z18reduccion_paralelaPjmmPjmm, @function
_Z40__device_stub__Z18reduccion_paralelaPjmmPjmm:
.LFB3670:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L48
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z18reduccion_paralelaPjmm(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L48:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3670:
	.size	_Z40__device_stub__Z18reduccion_paralelaPjmmPjmm, .-_Z40__device_stub__Z18reduccion_paralelaPjmmPjmm
	.globl	_Z18reduccion_paralelaPjmm
	.type	_Z18reduccion_paralelaPjmm, @function
_Z18reduccion_paralelaPjmm:
.LFB3671:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z18reduccion_paralelaPjmmPjmm
	.cfi_endproc
.LFE3671:
	.size	_Z18reduccion_paralelaPjmm, .-_Z18reduccion_paralelaPjmm
	.section	.rodata.str1.1
.LC20:
	.string	"_Z18reduccion_paralelaPjmm"
.LC21:
	.string	"_Z16reduccion_atomicPjmm"
.LC22:
	.string	"_Z18histograma_barreraPjS_mm"
.LC23:
	.string	"_Z22inicializar_histogramaPjm"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3673:
	.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	.LC20(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z18reduccion_paralelaPjmm(%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	.LC21(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16reduccion_atomicPjmm(%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	.LC22(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z18histograma_barreraPjS_mm(%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	.LC23(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z22inicializar_histogramaPjm(%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
.LFE3673:
	.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
.LC10:
	.long	1120403456
	.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 <iostream>
#include <hip/hip_runtime.h>


#include <stdio.h>
#include <cmath>


typedef unsigned int histogram_t;
typedef unsigned vector_t;

#define MIL 1000
#define MILLON MIL*MIL
#define N 80*MILLON
#define M 8                         //Tamaño histograma
#define TPB 1024                    //Threadsperblock
#define P (N+TPB-1)/TPB             //Nº sub-histogramas
#define R 106                       //Repeticiones para medir tiempo

#define SIZEH M*P*sizeof(histogram_t)
#define SIZEV N*sizeof(vector_t)

static void CheckCudaErrorAux (const char *file, unsigned line, const char *statement, hipError_t err)
{
	if (err == hipSuccess)
		return;
	std::cerr << statement<<" returned " << hipGetErrorString(err) << "("<<err<< ") at "<<file<<":"<<line << std::endl;
	exit (1);
}

static void CheckCudaErrorAux (const char *, unsigned, const char *, hipError_t);
#define CUDA_CHECK_RETURN(value) CheckCudaErrorAux(__FILE__,__LINE__, #value, value)

__global__ void inicializar_histograma(histogram_t * h, size_t n){
  size_t thread_id = threadIdx.x + blockDim.x * blockIdx.x;
  if(thread_id < n) h[thread_id] = 0;
}

// Este kernel se llama con 1 histograma local por cada bloque, con N hilos.
__global__ void histograma_barrera(histogram_t * h, vector_t * v, 
    size_t m, size_t n){
  //Inicialización del histograma local
  size_t thread_id = threadIdx.x + blockIdx.x*blockDim.x;
  if(thread_id < n){ 
    __shared__ histogram_t smem [M];
    if(threadIdx.x < M) smem[threadIdx.x] = 0;
    __syncthreads();

    size_t h_pos = v[thread_id]%m;
    atomicAdd(&smem[h_pos], 1);
    __syncthreads();

    if(threadIdx.x < M)
      h[blockIdx.x*M + threadIdx.x] = smem[threadIdx.x];
  }
}

__global__ void reduccion_atomic(histogram_t * h, size_t m, size_t p){
  size_t thread_id = threadIdx.x + blockDim.x * blockIdx.x;
  if(thread_id >= m*p || thread_id < m) return;
  atomicAdd(&h[thread_id%m], h[thread_id]);
}

//Hay un hilo por cada dos posiciones del histograma m*(p/2)
__global__ void reduccion_paralela(histogram_t * h, size_t m, size_t p){
  size_t thread_id = threadIdx.x + blockDim.x * blockIdx.x;
  if(thread_id >= m*(p/2)) return;
  h[thread_id] += h[thread_id + m*(p/2)];
  if((p%2) && thread_id < m)
    h[thread_id] += h[thread_id + 2*m*(p/2)];
}

float tiempo_kernel(histogram_t * h, vector_t * v, unsigned kernel);

void print_vector (histogram_t * h, size_t n);
void print_vector_device (histogram_t * h, size_t n);
int main (void){
  vector_t * v = (vector_t*)malloc(SIZEV);
  for(int i = 0; i < N; i++) v[i] = rand();
  vector_t * v_device;
  CUDA_CHECK_RETURN(hipMalloc(&v_device, SIZEV));
  CUDA_CHECK_RETURN(hipMemcpy(v_device, v, SIZEV, hipMemcpyHostToDevice));

  histogram_t * h = (histogram_t*)malloc(SIZEH);
  histogram_t * h_device;
  CUDA_CHECK_RETURN(hipMalloc(&h_device, SIZEH));

  printf("Llamando kernel con M = %i N = %i y P = %i\n", M, N, P);

  float elapsedTime = tiempo_kernel(h_device, v_device, 1);

  printf("Tiempo transcurrido: %f ms\n", elapsedTime);

  CUDA_CHECK_RETURN(hipMemcpy(h, h_device, SIZEH, hipMemcpyDeviceToHost));

  long long unsigned n_resultado = 0;
  for(int i = 0; i < M; i++){
    n_resultado+=h[i];
  }
  printf("Suma de elementos del histogr.: %llu\n", n_resultado);
  printf("Numero de elementos del vector: %i\n", N);

  free(v);
  hipFree(v_device);
  free(h);
  hipFree(h_device);
}

float tiempo_kernel(histogram_t * h, vector_t * v, unsigned kernel = 1){
  size_t threadsPerBlock = 1024;
  size_t blocksPerGridM = ((unsigned)M + threadsPerBlock - 1) / threadsPerBlock;
  size_t blocksPerGridN = ((unsigned)N + threadsPerBlock - 1) / threadsPerBlock;
  size_t blocksPerGridPM = ((unsigned)(P*M) + threadsPerBlock - 1) / threadsPerBlock;
  size_t blocksReduccion;
  
  hipEvent_t start,stop, reduccion;
  hipEventCreate(&start);
  hipEventCreate(&reduccion);
  hipEventCreate(&stop);
  float totalTime = 0, totalCalculo = 0, totalReduccion = 0;

  for(int i = 0; i < R; i++){
    size_t p = P;
    hipEventRecord(start, 0);
    histograma_barrera <<<blocksPerGridN, threadsPerBlock>>>(h, v, M, N);
    hipEventRecord(reduccion, 0);
    reduccion_atomic<<<blocksPerGridPM, threadsPerBlock>>>(h, M, p);
    hipEventRecord(stop, 0);
    hipEventSynchronize(stop);

    float elapsedTime;
    hipEventElapsedTime(&elapsedTime, start, stop);
    if(i > 5) totalTime += elapsedTime;
    hipEventElapsedTime(&elapsedTime, start, reduccion);
    if(i > 5) totalCalculo += elapsedTime;
    hipEventElapsedTime(&elapsedTime, reduccion, stop);
    if(i > 5) totalReduccion += elapsedTime;
  }
  printf("Tiempo de calculo %f ms ; tiempo reduccion %f ms \n ", totalCalculo/(R-6),totalReduccion/(R-6));

  return totalTime / (R-6);
}

void print_vector (histogram_t * h, size_t n){
  printf("n=%llu ", n);
  unsigned suma = 0;
  for(int i = 0; i < n; i++){
    suma += h[i];
    printf("%i ", h[i]);
  }
  printf("\nSuma: %u\n", suma);
}
void print_vector_device (histogram_t * h, size_t n){
  histogram_t * h_host = (histogram_t*)malloc(SIZEH);
  CUDA_CHECK_RETURN(hipMemcpy(h_host, h, SIZEH, hipMemcpyDeviceToHost)); 
  print_vector(h_host, n);
  free(h_host);
}

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

                                        # End of file scope inline assembly
	.globl	_Z37__device_stub__inicializar_histogramaPjm # -- Begin function _Z37__device_stub__inicializar_histogramaPjm
	.type	_Z37__device_stub__inicializar_histogramaPjm,@function
_Z37__device_stub__inicializar_histogramaPjm: # @_Z37__device_stub__inicializar_histogramaPjm
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z22inicializar_histogramaPjm, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z37__device_stub__inicializar_histogramaPjm, .Lfunc_end0-_Z37__device_stub__inicializar_histogramaPjm
	.cfi_endproc
                                        # -- End function
	.globl	_Z33__device_stub__histograma_barreraPjS_mm # -- Begin function _Z33__device_stub__histograma_barreraPjS_mm
	.type	_Z33__device_stub__histograma_barreraPjS_mm,@function
_Z33__device_stub__histograma_barreraPjS_mm: # @_Z33__device_stub__histograma_barreraPjS_mm
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%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	8(%rsp), %r12
	movq	%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	$_Z18histograma_barreraPjS_mm, %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_end1:
	.size	_Z33__device_stub__histograma_barreraPjS_mm, .Lfunc_end1-_Z33__device_stub__histograma_barreraPjS_mm
	.cfi_endproc
                                        # -- End function
	.globl	_Z31__device_stub__reduccion_atomicPjmm # -- Begin function _Z31__device_stub__reduccion_atomicPjmm
	.type	_Z31__device_stub__reduccion_atomicPjmm,@function
_Z31__device_stub__reduccion_atomicPjmm: # @_Z31__device_stub__reduccion_atomicPjmm
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%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	$_Z16reduccion_atomicPjmm, %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	_Z31__device_stub__reduccion_atomicPjmm, .Lfunc_end2-_Z31__device_stub__reduccion_atomicPjmm
	.cfi_endproc
                                        # -- End function
	.globl	_Z33__device_stub__reduccion_paralelaPjmm # -- Begin function _Z33__device_stub__reduccion_paralelaPjmm
	.type	_Z33__device_stub__reduccion_paralelaPjmm,@function
_Z33__device_stub__reduccion_paralelaPjmm: # @_Z33__device_stub__reduccion_paralelaPjmm
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%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	$_Z18reduccion_paralelaPjmm, %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_end3:
	.size	_Z33__device_stub__reduccion_paralelaPjmm, .Lfunc_end3-_Z33__device_stub__reduccion_paralelaPjmm
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.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	$16, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$320000000, %edi                # imm = 0x1312D000
	callq	malloc
	movq	%rax, %rbx
	xorl	%r14d, %r14d
.LBB4_1:                                # =>This Inner Loop Header: Depth=1
	callq	rand
	movl	%eax, (%rbx,%r14,4)
	incq	%r14
	cmpq	$80000000, %r14                 # imm = 0x4C4B400
	jne	.LBB4_1
# %bb.2:
	leaq	8(%rsp), %r15
	movl	$320000000, %esi                # imm = 0x1312D000
	movq	%r15, %rdi
	callq	hipMalloc
	movl	$.L.str.1, %esi
	movl	$81, %edi
	movl	%eax, %edx
	callq	_ZL17CheckCudaErrorAuxPKcjS0_10hipError_t
	movq	(%r15), %rdi
	movl	$320000000, %edx                # imm = 0x1312D000
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$.L.str.2, %esi
	movl	$82, %edi
	movl	%eax, %edx
	callq	_ZL17CheckCudaErrorAuxPKcjS0_10hipError_t
	movl	$2500028, %edi                  # imm = 0x2625BC
	callq	malloc
	movq	%rax, %r14
	movq	%rsp, %r12
	movl	$2500028, %esi                  # imm = 0x2625BC
	movq	%r12, %rdi
	callq	hipMalloc
	movl	$.L.str.3, %esi
	movl	$86, %edi
	movl	%eax, %edx
	callq	_ZL17CheckCudaErrorAuxPKcjS0_10hipError_t
	xorl	%r13d, %r13d
	movl	$.L.str.4, %edi
	movl	$8, %esi
	movl	$80000000, %edx                 # imm = 0x4C4B400
	movl	$78125, %ecx                    # imm = 0x1312D
	xorl	%eax, %eax
	callq	printf
	movq	(%r12), %rdi
	movq	(%r15), %rsi
	callq	_Z13tiempo_kernelPjS_j
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.5, %edi
	movb	$1, %al
	callq	printf
	movq	(%r12), %rsi
	movl	$2500028, %edx                  # imm = 0x2625BC
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$.L.str.6, %esi
	movl	$94, %edi
	movl	%eax, %edx
	callq	_ZL17CheckCudaErrorAuxPKcjS0_10hipError_t
	xorl	%esi, %esi
.LBB4_3:                                # =>This Inner Loop Header: Depth=1
	movl	(%r14,%r13,4), %eax
	addq	%rax, %rsi
	incq	%r13
	cmpq	$8, %r13
	jne	.LBB4_3
# %bb.4:
	movl	$.L.str.7, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.8, %edi
	movl	$80000000, %esi                 # imm = 0x4C4B400
	xorl	%eax, %eax
	callq	printf
	movq	%rbx, %rdi
	callq	free
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	%r14, %rdi
	callq	free
	movq	(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	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_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
                                        # -- End function
	.type	_ZL17CheckCudaErrorAuxPKcjS0_10hipError_t,@function # -- Begin function _ZL17CheckCudaErrorAuxPKcjS0_10hipError_t
_ZL17CheckCudaErrorAuxPKcjS0_10hipError_t: # @_ZL17CheckCudaErrorAuxPKcjS0_10hipError_t
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jne	.LBB5_2
# %bb.1:
	retq
.LBB5_2:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebp
	movl	%edi, %ebx
	movl	$_ZSt4cerr, %edi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.14, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %r14
	movl	%ebp, %edi
	callq	hipGetErrorString
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.15, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
	movl	$.L.str.16, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.17, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movl	%ebx, %esi
	callq	_ZNSolsEj
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	movl	$1, %edi
	callq	exit
.Lfunc_end5:
	.size	_ZL17CheckCudaErrorAuxPKcjS0_10hipError_t, .Lfunc_end5-_ZL17CheckCudaErrorAuxPKcjS0_10hipError_t
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z13tiempo_kernelPjS_j
.LCPI6_0:
	.long	0x80000000                      # float -0
.LCPI6_1:
	.long	0x42c80000                      # float 100
	.text
	.globl	_Z13tiempo_kernelPjS_j
	.type	_Z13tiempo_kernelPjS_j,@function
_Z13tiempo_kernelPjS_j:                 # @_Z13tiempo_kernelPjS_j
	.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	$72, %rsp
	.cfi_def_cfa_offset 128
	.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	%rsi, 64(%rsp)                  # 8-byte Spill
	movq	%rdi, %r14
	movabsq	$4294968320, %r15               # imm = 0x100000400
	leaq	40(%rsp), %rdi
	callq	hipEventCreate
	leaq	32(%rsp), %rdi
	callq	hipEventCreate
	leaq	24(%rsp), %rdi
	callq	hipEventCreate
	xorl	%ebx, %ebx
	xorps	%xmm0, %xmm0
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	leaq	77101(%r15), %r12
	leaq	-413(%r15), %r13
	leaq	16(%rsp), %rbp
	xorps	%xmm1, %xmm1
.LBB6_1:                                # =>This Inner Loop Header: Depth=1
	movss	%xmm0, 56(%rsp)                 # 4-byte Spill
	movss	%xmm1, 60(%rsp)                 # 4-byte Spill
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_3
# %bb.2:                                #   in Loop: Header=BB6_1 Depth=1
	movl	$8, %edx
	movl	$80000000, %ecx                 # imm = 0x4C4B400
	movq	%r14, %rdi
	movq	64(%rsp), %rsi                  # 8-byte Reload
	callq	_Z33__device_stub__histograma_barreraPjS_mm
.LBB6_3:                                #   in Loop: Header=BB6_1 Depth=1
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_5
# %bb.4:                                #   in Loop: Header=BB6_1 Depth=1
	movl	$8, %esi
	movl	$78125, %edx                    # imm = 0x1312D
	movq	%r14, %rdi
	callq	_Z31__device_stub__reduccion_atomicPjmm
.LBB6_5:                                #   in Loop: Header=BB6_1 Depth=1
	movq	24(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	24(%rsp), %rdi
	callq	hipEventSynchronize
	movq	40(%rsp), %rsi
	movq	24(%rsp), %rdx
	movq	%rbp, %rdi
	callq	hipEventElapsedTime
	movss	16(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 20(%rsp)                 # 4-byte Spill
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	%rbp, %rdi
	callq	hipEventElapsedTime
	movss	16(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 52(%rsp)                 # 4-byte Spill
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
	movq	%rbp, %rdi
	callq	hipEventElapsedTime
	cmpl	$6, %ebx
	jae	.LBB6_7
# %bb.6:                                #   in Loop: Header=BB6_1 Depth=1
	movss	.LCPI6_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 20(%rsp)                 # 4-byte Spill
.LBB6_7:                                #   in Loop: Header=BB6_1 Depth=1
	movss	60(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movss	52(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	jae	.LBB6_9
# %bb.8:                                #   in Loop: Header=BB6_1 Depth=1
	movss	.LCPI6_0(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
.LBB6_9:                                #   in Loop: Header=BB6_1 Depth=1
	jae	.LBB6_10
# %bb.11:                               #   in Loop: Header=BB6_1 Depth=1
	movss	.LCPI6_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	jmp	.LBB6_12
.LBB6_10:                               #   in Loop: Header=BB6_1 Depth=1
	movss	16(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
.LBB6_12:                               #   in Loop: Header=BB6_1 Depth=1
	addss	%xmm0, %xmm1
	movss	12(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	addss	20(%rsp), %xmm0                 # 4-byte Folded Reload
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movss	56(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	addss	%xmm2, %xmm0
	incl	%ebx
	cmpl	$106, %ebx
	jne	.LBB6_1
# %bb.13:
	movss	.LCPI6_1(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	divss	%xmm2, %xmm0
	cvtss2sd	%xmm0, %xmm0
	divss	%xmm2, %xmm1
	cvtss2sd	%xmm1, %xmm1
	movl	$.L.str.9, %edi
	movb	$2, %al
	callq	printf
	movss	12(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI6_1(%rip), %xmm0
	addq	$72, %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
.Lfunc_end6:
	.size	_Z13tiempo_kernelPjS_j, .Lfunc_end6-_Z13tiempo_kernelPjS_j
	.cfi_endproc
                                        # -- End function
	.globl	_Z12print_vectorPjm             # -- Begin function _Z12print_vectorPjm
	.type	_Z12print_vectorPjm,@function
_Z12print_vectorPjm:                    # @_Z12print_vectorPjm
	.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	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %rbx
	movq	%rdi, %r14
	xorl	%ebp, %ebp
	movl	$.L.str.10, %edi
	xorl	%eax, %eax
	callq	printf
	testq	%rbx, %rbx
	je	.LBB7_3
# %bb.1:                                # %.lr.ph.preheader
	xorl	%r15d, %r15d
	xorl	%ebp, %ebp
.LBB7_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%r14,%r15,4), %esi
	addl	%esi, %ebp
	movl	$.L.str.11, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r15
	cmpq	%r15, %rbx
	jne	.LBB7_2
.LBB7_3:                                # %._crit_edge
	movl	$.L.str.12, %edi
	movl	%ebp, %esi
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.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
	jmp	printf                          # TAILCALL
.Lfunc_end7:
	.size	_Z12print_vectorPjm, .Lfunc_end7-_Z12print_vectorPjm
	.cfi_endproc
                                        # -- End function
	.globl	_Z19print_vector_devicePjm      # -- Begin function _Z19print_vector_devicePjm
	.type	_Z19print_vector_devicePjm,@function
_Z19print_vector_devicePjm:             # @_Z19print_vector_devicePjm
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	$2500028, %edi                  # imm = 0x2625BC
	callq	malloc
	movq	%rax, %r15
	movl	$2500028, %edx                  # imm = 0x2625BC
	movq	%rax, %rdi
	movq	%r14, %rsi
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$.L.str.13, %esi
	movl	$155, %edi
	movl	%eax, %edx
	callq	_ZL17CheckCudaErrorAuxPKcjS0_10hipError_t
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_Z12print_vectorPjm
	movq	%r15, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	free                            # TAILCALL
.Lfunc_end8:
	.size	_Z19print_vector_devicePjm, .Lfunc_end8-_Z19print_vector_devicePjm
	.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	.LBB9_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB9_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z22inicializar_histogramaPjm, %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	$_Z18histograma_barreraPjS_mm, %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	$_Z16reduccion_atomicPjmm, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z18reduccion_paralelaPjmm, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %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_end9:
	.size	__hip_module_ctor, .Lfunc_end9-__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	.LBB10_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
.LBB10_2:
	retq
.Lfunc_end10:
	.size	__hip_module_dtor, .Lfunc_end10-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z22inicializar_histogramaPjm,@object # @_Z22inicializar_histogramaPjm
	.section	.rodata,"a",@progbits
	.globl	_Z22inicializar_histogramaPjm
	.p2align	3, 0x0
_Z22inicializar_histogramaPjm:
	.quad	_Z37__device_stub__inicializar_histogramaPjm
	.size	_Z22inicializar_histogramaPjm, 8

	.type	_Z18histograma_barreraPjS_mm,@object # @_Z18histograma_barreraPjS_mm
	.globl	_Z18histograma_barreraPjS_mm
	.p2align	3, 0x0
_Z18histograma_barreraPjS_mm:
	.quad	_Z33__device_stub__histograma_barreraPjS_mm
	.size	_Z18histograma_barreraPjS_mm, 8

	.type	_Z16reduccion_atomicPjmm,@object # @_Z16reduccion_atomicPjmm
	.globl	_Z16reduccion_atomicPjmm
	.p2align	3, 0x0
_Z16reduccion_atomicPjmm:
	.quad	_Z31__device_stub__reduccion_atomicPjmm
	.size	_Z16reduccion_atomicPjmm, 8

	.type	_Z18reduccion_paralelaPjmm,@object # @_Z18reduccion_paralelaPjmm
	.globl	_Z18reduccion_paralelaPjmm
	.p2align	3, 0x0
_Z18reduccion_paralelaPjmm:
	.quad	_Z33__device_stub__reduccion_paralelaPjmm
	.size	_Z18reduccion_paralelaPjmm, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/mbdaso/cuda/master/histograma-reduccion-barrera/main.hip"
	.size	.L.str, 119

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"hipMalloc(&v_device, SIZEV)"
	.size	.L.str.1, 28

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"hipMemcpy(v_device, v, SIZEV, hipMemcpyHostToDevice)"
	.size	.L.str.2, 53

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"hipMalloc(&h_device, SIZEH)"
	.size	.L.str.3, 28

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Llamando kernel con M = %i N = %i y P = %i\n"
	.size	.L.str.4, 44

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Tiempo transcurrido: %f ms\n"
	.size	.L.str.5, 28

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"hipMemcpy(h, h_device, SIZEH, hipMemcpyDeviceToHost)"
	.size	.L.str.6, 53

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Suma de elementos del histogr.: %llu\n"
	.size	.L.str.7, 38

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Numero de elementos del vector: %i\n"
	.size	.L.str.8, 36

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Tiempo de calculo %f ms ; tiempo reduccion %f ms \n "
	.size	.L.str.9, 52

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"n=%llu "
	.size	.L.str.10, 8

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"%i "
	.size	.L.str.11, 4

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"\nSuma: %u\n"
	.size	.L.str.12, 11

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"hipMemcpy(h_host, h, SIZEH, hipMemcpyDeviceToHost)"
	.size	.L.str.13, 51

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	" returned "
	.size	.L.str.14, 11

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

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	") at "
	.size	.L.str.16, 6

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z22inicializar_histogramaPjm"
	.size	.L__unnamed_1, 30

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

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z16reduccion_atomicPjmm"
	.size	.L__unnamed_3, 25

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z18reduccion_paralelaPjmm"
	.size	.L__unnamed_4, 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

	.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 _Z37__device_stub__inicializar_histogramaPjm
	.addrsig_sym _Z33__device_stub__histograma_barreraPjS_mm
	.addrsig_sym _Z31__device_stub__reduccion_atomicPjmm
	.addrsig_sym _Z33__device_stub__reduccion_paralelaPjmm
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z22inicializar_histogramaPjm
	.addrsig_sym _Z18histograma_barreraPjS_mm
	.addrsig_sym _Z16reduccion_atomicPjmm
	.addrsig_sym _Z18reduccion_paralelaPjmm
	.addrsig_sym _ZSt4cerr
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z22inicializar_histogramaPjm ; -- Begin function _Z22inicializar_histogramaPjm
	.globl	_Z22inicializar_histogramaPjm
	.p2align	8
	.type	_Z22inicializar_histogramaPjm,@function
_Z22inicializar_histogramaPjm:          ; @_Z22inicializar_histogramaPjm
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x1c
	s_load_b128 s[0:3], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	v_mov_b32_e32 v2, 0
	v_cmp_gt_u64_e32 vcc_lo, s[2:3], v[1:2]
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB0_2
; %bb.1:
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v2, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z22inicializar_histogramaPjm
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.amdhsa_user_sgpr_count 15
		.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 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 3
		.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	_Z22inicializar_histogramaPjm, .Lfunc_end0-_Z22inicializar_histogramaPjm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 104
; NumSgprs: 18
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 3
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z18histograma_barreraPjS_mm ; -- Begin function _Z18histograma_barreraPjS_mm
	.globl	_Z18histograma_barreraPjS_mm
	.p2align	8
	.type	_Z18histograma_barreraPjS_mm,@function
_Z18histograma_barreraPjS_mm:           ; @_Z18histograma_barreraPjS_mm
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b256 s[4:11], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s0, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s0, v[0:1]
	v_mov_b32_e32 v2, 0
	s_mov_b32 s0, exec_lo
	v_cmpx_gt_u64_e64 s[10:11], v[1:2]
	s_cbranch_execz .LBB1_5
; %bb.1:
	v_cmp_gt_u32_e64 s0, 8, v0
	v_lshlrev_b32_e32 v3, 2, v0
	s_delay_alu instid0(VALU_DEP_2)
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB1_3
; %bb.2:
	v_mov_b32_e32 v4, 0
	ds_store_b32 v3, v4
.LBB1_3:
	s_or_b32 exec_lo, exec_lo, s1
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_sub_u32 s1, 0, s8
	s_subb_u32 s2, 0, s9
	v_add_co_u32 v1, vcc_lo, s6, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s7, v2, vcc_lo
	global_load_b32 v6, v[1:2], off
	v_cvt_f32_u32_e32 v1, s8
	v_cvt_f32_u32_e32 v2, s9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmamk_f32 v1, v2, 0x4f800000, v1
	v_rcp_f32_e32 v1, v1
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v1, 0x5f7ffffc, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v2, 0x2f800000, v1
	v_trunc_f32_e32 v2, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmamk_f32 v1, v2, 0xcf800000, v1
	v_cvt_u32_f32_e32 v2, v2
	v_cvt_u32_f32_e32 v1, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_lo_u32 v4, s1, v2
	v_mul_hi_u32 v5, s1, v1
	v_mul_lo_u32 v7, s2, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v4, v5, v4
	v_mul_lo_u32 v5, s1, v1
	v_add_nc_u32_e32 v4, v4, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_hi_u32 v7, v1, v5
	v_mul_lo_u32 v8, v1, v4
	v_mul_hi_u32 v9, v1, v4
	v_mul_hi_u32 v10, v2, v5
	v_mul_lo_u32 v5, v2, v5
	v_mul_hi_u32 v11, v2, v4
	v_mul_lo_u32 v4, v2, v4
	v_add_co_u32 v7, vcc_lo, v7, v8
	v_add_co_ci_u32_e32 v8, vcc_lo, 0, v9, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, v7, v5
	v_add_co_ci_u32_e32 v5, vcc_lo, v8, v10, vcc_lo
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v11, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, v5, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, v1, v4
	v_add_co_ci_u32_e32 v2, vcc_lo, v2, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_hi_u32 v4, s1, v1
	v_mul_lo_u32 v7, s2, v1
	v_mul_lo_u32 v5, s1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v4, v4, v5
	v_mul_lo_u32 v5, s1, v1
	v_add_nc_u32_e32 v4, v4, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_hi_u32 v7, v1, v5
	v_mul_lo_u32 v8, v1, v4
	v_mul_hi_u32 v9, v1, v4
	v_mul_hi_u32 v10, v2, v5
	v_mul_lo_u32 v5, v2, v5
	v_mul_hi_u32 v11, v2, v4
	v_mul_lo_u32 v4, v2, v4
	v_add_co_u32 v7, vcc_lo, v7, v8
	v_add_co_ci_u32_e32 v8, vcc_lo, 0, v9, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, v7, v5
	v_add_co_ci_u32_e32 v5, vcc_lo, v8, v10, vcc_lo
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v11, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, v5, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, v1, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, v2, v5, vcc_lo
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mad_u64_u32 v[1:2], null, v6, v5, 0
	v_mul_hi_u32 v4, v6, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v1, vcc_lo, v4, v1
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s8, v7, 0
	v_mad_u64_u32 v[4:5], null, s9, v7, v[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_co_u32 v1, vcc_lo, v6, v1
	v_sub_nc_u32_e32 v2, 0, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_subrev_co_ci_u32_e64 v2, s1, s9, v2, vcc_lo
	v_sub_co_u32 v5, s1, v1, s8
	v_sub_co_ci_u32_e32 v4, vcc_lo, 0, v4, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_subrev_co_ci_u32_e64 v2, s1, 0, v2, s1
	v_cmp_le_u32_e32 vcc_lo, s8, v5
	v_cndmask_b32_e64 v6, 0, -1, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_cmp_le_u32_e32 vcc_lo, s9, v2
	v_cndmask_b32_e64 v7, 0, -1, vcc_lo
	v_cmp_le_u32_e32 vcc_lo, s8, v1
	v_cndmask_b32_e64 v8, 0, -1, vcc_lo
	v_cmp_le_u32_e32 vcc_lo, s9, v4
	v_cndmask_b32_e64 v9, 0, -1, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, s9, v2
	v_cndmask_b32_e32 v2, v7, v6, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, s9, v4
	v_subrev_nc_u32_e32 v6, s8, v5
	v_cndmask_b32_e32 v4, v9, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_ne_u32_e32 vcc_lo, 0, v2
	v_cndmask_b32_e32 v2, v5, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ne_u32_e32 vcc_lo, 0, v4
	v_dual_cndmask_b32 v1, v1, v2 :: v_dual_mov_b32 v2, 1
	s_delay_alu instid0(VALU_DEP_1)
	v_lshlrev_b32_e32 v1, 2, v1
	ds_add_u32 v1, v2
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 exec_lo, exec_lo, s0
	s_cbranch_execz .LBB1_5
; %bb.4:
	ds_load_b32 v2, v3
	v_lshl_or_b32 v0, s15, 3, v0
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v0, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	s_waitcnt lgkmcnt(0)
	global_store_b32 v[0:1], v2, off
.LBB1_5:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z18histograma_barreraPjS_mm
		.amdhsa_group_segment_fixed_size 32
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.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 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 12
		.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	_Z18histograma_barreraPjS_mm, .Lfunc_end1-_Z18histograma_barreraPjS_mm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 896
; NumSgprs: 18
; NumVgprs: 12
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 32 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 12
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z16reduccion_atomicPjmm ; -- Begin function _Z16reduccion_atomicPjmm
	.globl	_Z16reduccion_atomicPjmm
	.p2align	8
	.type	_Z16reduccion_atomicPjmm,@function
_Z16reduccion_atomicPjmm:               ; @_Z16reduccion_atomicPjmm
; %bb.0:
	s_clause 0x2
	s_load_b32 s2, s[0:1], 0x24
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mul_i32 s3, s0, s7
	s_mul_hi_u32 s2, s0, s6
	v_mov_b32_e32 v2, 0
	s_mul_i32 s1, s1, s6
	s_add_i32 s2, s2, s3
	s_mul_i32 s0, s0, s6
	s_add_i32 s1, s2, s1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_gt_u64_e32 vcc_lo, s[0:1], v[1:2]
	v_cmp_le_u64_e64 s0, s[6:7], v[1:2]
	s_and_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB2_2
; %bb.1:
	v_lshlrev_b64 v[3:4], 2, v[1:2]
	v_cvt_f32_u32_e32 v0, s6
	s_sub_i32 s0, 0, s6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_rcp_iflag_f32_e32 v0, v0
	v_add_co_u32 v3, vcc_lo, s4, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v4, vcc_lo, s5, v4, vcc_lo
	global_load_b32 v3, v[3:4], off
	v_mul_f32_e32 v0, 0x4f7ffffe, v0
	v_cvt_u32_f32_e32 v0, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v4, s0, v0
	v_mul_hi_u32 v4, v0, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v0, v4
	v_mul_hi_u32 v0, v1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v0, v0, s6
	v_sub_nc_u32_e32 v0, v1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v1, s6, v0
	v_cmp_le_u32_e32 vcc_lo, s6, v0
	v_cndmask_b32_e32 v0, v0, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v1, s6, v0
	v_cmp_le_u32_e32 vcc_lo, s6, v0
	v_cndmask_b32_e32 v1, v0, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	v_add_co_u32 v0, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	s_waitcnt vmcnt(0)
	global_atomic_add_u32 v[0:1], v3, off
.LBB2_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z16reduccion_atomicPjmm
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.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 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 5
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z16reduccion_atomicPjmm, .Lfunc_end2-_Z16reduccion_atomicPjmm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 308
; NumSgprs: 18
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 5
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z18reduccion_paralelaPjmm ; -- Begin function _Z18reduccion_paralelaPjmm
	.globl	_Z18reduccion_paralelaPjmm
	.p2align	8
	.type	_Z18reduccion_paralelaPjmm,@function
_Z18reduccion_paralelaPjmm:             ; @_Z18reduccion_paralelaPjmm
; %bb.0:
	s_clause 0x2
	s_load_b64 s[2:3], s[0:1], 0x10
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b32 s0, s[0:1], 0x24
	s_waitcnt lgkmcnt(0)
	v_alignbit_b32 v3, s3, s2, 1
	s_and_b32 s0, s0, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[1:2], null, s15, s0, v[0:1]
	v_mul_lo_u32 v4, v3, s7
	v_mul_hi_u32 v5, v3, s6
	s_lshr_b32 s0, s3, 1
	v_mul_lo_u32 v3, v3, s6
	s_mul_i32 s0, s0, s6
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v5, v4
	v_add_nc_u32_e32 v4, s0, v0
	s_mov_b32 s0, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u64_e64 v[3:4], v[1:2]
	s_cbranch_execz .LBB3_3
; %bb.1:
	v_lshlrev_b64 v[5:6], 2, v[3:4]
	v_lshlrev_b64 v[3:4], 2, v[1:2]
	s_bitcmp1_b32 s2, 0
	s_cselect_b32 s0, -1, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v0, vcc_lo, s4, v5
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v7, vcc_lo, v0, v3
	v_add_co_ci_u32_e32 v8, vcc_lo, v5, v4, vcc_lo
	v_add_co_u32 v5, vcc_lo, s4, v3
	v_add_co_ci_u32_e32 v6, vcc_lo, s5, v4, vcc_lo
	v_cmp_gt_u64_e32 vcc_lo, s[6:7], v[1:2]
	s_clause 0x1
	global_load_b32 v0, v[7:8], off
	global_load_b32 v7, v[5:6], off
	s_and_b32 s0, s0, vcc_lo
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v0, v7, v0
	global_store_b32 v[5:6], v0, off
	s_and_b32 exec_lo, exec_lo, s0
	s_cbranch_execz .LBB3_3
; %bb.2:
	s_lshr_b64 s[0:1], s[2:3], 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_mul_i32 s1, s6, s1
	s_mul_hi_u32 s2, s6, s0
	s_mul_i32 s3, s7, s0
	s_add_i32 s1, s2, s1
	s_mul_i32 s0, s6, s0
	s_add_i32 s1, s1, s3
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[0:1], s[0:1], 3
	s_add_u32 s0, s4, s0
	s_addc_u32 s1, s5, s1
	v_add_co_u32 v1, vcc_lo, s0, v3
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v4, vcc_lo
	global_load_b32 v1, v[1:2], off
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v0, v1, v0
	global_store_b32 v[5:6], v0, off
.LBB3_3:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z18reduccion_paralelaPjmm
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.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 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end3:
	.size	_Z18reduccion_paralelaPjmm, .Lfunc_end3-_Z18reduccion_paralelaPjmm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 344
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.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
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z22inicializar_histogramaPjm
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z22inicializar_histogramaPjm.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     3
    .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:           8
        .value_kind:     by_value
      - .offset:         24
        .size:           8
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 32
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z18histograma_barreraPjS_mm
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z18histograma_barreraPjS_mm.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     12
    .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:           8
        .value_kind:     by_value
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z16reduccion_atomicPjmm
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z16reduccion_atomicPjmm.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     5
    .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:           8
        .value_kind:     by_value
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z18reduccion_paralelaPjmm
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z18reduccion_paralelaPjmm.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
