#include <stdio.h>
#include <stdlib.h>
#include <chrono>
#include <cmath>
#include <string>
#include <iostream>

using namespace std::chrono;
using namespace std;

__global__ void addMatOnDevice2D(float *in1, float *in2, float *out, int nx, int ny)
{
    int ix = threadIdx.x + blockIdx.x * blockDim.x;
    int iy = threadIdx.y + blockIdx.y * blockDim.y;
    if (ix < nx && iy < ny)
    {
        int i = iy * nx + ix;
        out[i] = in1[i] + in2[i];
    }
}

__global__ void addMatOnDevice1D(float *in1, float *in2, float *out, int nx, int ny)
{
    int ix = threadIdx.x + blockIdx.x * blockDim.x;
    if (ix < nx)
    {
        for (int iy = 0; iy < ny; iy++)
        {
            int idx = iy * nx + ix;
            out[idx] = in1[idx] + in2[idx];
        }
    }
}

__global__ void addMatOnDeviceMix(float *in1, float *in2, float *out, int nx, int ny)
{
    int ix = threadIdx.x + blockIdx.x * blockDim.x;
    int iy = blockIdx.y;
    if (ix < nx)
    {
        int idx = iy * nx + ix;
        out[idx] = in1[idx] + in2[idx];
    }
}

void addMatOnHost(float *in1, float *in2, float *out,
                  int nx, int ny)
{
    for (int i = 0; i < ny; i++)
        for (int j = 0; j < nx; j++){
            int idx = i * nx + j;
            out[idx] = in1[idx] + in2[idx];
        }
}

void printMatrix(float *matrix, int nx, int ny)
{
    printf("\n");
    for (int i = 0; i < ny; i++){
        for (int j = 0; j < nx; j++){
            int idx = i * ny + j;
            printf("%f ", matrix[idx]);
        }
        printf("\n");
    }
}

void calcTimeOnDevice(float *in1, float *in2, float *out, int nx, int ny, dim3 blockSize, dim3 gridSize, int typeDevice)
{
    int size = nx * ny * sizeof(float);

    // Allocate vector to device memory
    float *d_in1, *d_in2, *d_out;
    cudaMalloc(&d_in1, size);
    cudaMalloc(&d_in2, size);
    cudaMalloc(&d_out, size);

    // Copy inputs to device
    cudaMemcpy(d_in1, in1, size, cudaMemcpyHostToDevice);
    cudaMemcpy(d_in2, in2, size, cudaMemcpyHostToDevice);

    auto start_device = high_resolution_clock::now();
    string deviceName = "";
    if (typeDevice == 1){
        deviceName = "addMatOnDevice2D";
        addMatOnDevice2D<<<gridSize, blockSize>>>(d_in1, d_in2, d_out, nx, ny);
    }else if (typeDevice == 2){
        deviceName = "addMatOnDevice1D";
        addMatOnDevice1D<<<gridSize, blockSize>>>(d_in1, d_in2, d_out, nx, ny);
    }else if (typeDevice == 3){
        deviceName = "addMatOnDevice2DNotMix";
        addMatOnDevice2D<<<gridSize, blockSize>>>(d_in1, d_in2, d_out, nx, ny);
    }else {
        deviceName = "addMatOnDeviceMix";
        addMatOnDeviceMix<<<gridSize, blockSize>>>(d_in1, d_in2, d_out, nx, ny);
    }
    
    cudaDeviceSynchronize();
    cudaGetLastError();
    cudaMemcpy(out, d_out, size, cudaMemcpyDeviceToHost);
    auto stop_device = high_resolution_clock::now();
    auto duration_device = duration_cast<microseconds>(stop_device - start_device);
    auto duration = duration_device.count();
 
    printf("%s|%d x %d\t|%d x %d\t|%d ms\t\n", deviceName.c_str(), blockSize.x, blockSize.y, gridSize.x, gridSize.y, duration);

     // Cleanup
    cudaFree(d_in1);
    cudaFree(d_in2);
    cudaFree(d_out);
}


int main()
{
    int nx, ny;       // Số cột và số dòng
    float *in1, *in2; // input matrix
    float *out;       // output vector

    nx = pow(2, 13) + 1;
    ny = pow(2, 13) + 1;

    int size = nx * ny * sizeof(float);

    in1 = (float *)malloc(size);
    in2 = (float *)malloc(size);
    out = (float *)malloc(size);

    // Setup input values
    srand(time(0));
    for (int i = 0; i < ny; i++){
        for (int j = 0; j < nx; j++){
            int idx = i * ny + j;
            in1[idx] = static_cast<float>(rand()) / static_cast<float>(RAND_MAX);
            in2[idx] = static_cast<float>(rand()) / static_cast<float>(RAND_MAX);
        }
    }

    auto start_host = high_resolution_clock::now();
    addMatOnHost(in1, in2, out, nx, ny);
    auto stop_host = high_resolution_clock::now();
    auto duration_host = duration_cast<microseconds>(stop_host - start_host);
    printf("Function\t|Block size\t|Grid size\t|Time (ms)\n");
    printf("addMatOnHost\t|\t\t|\t\t|%d\n", duration_host.count());


    /********************************
    addMatOnDevice2D
    *********************************/
    int typeDevice = 1;

    dim3 blockSize(32, 32);
    dim3 gridSize(257, 257);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(16, 32);
    gridSize = dim3(513, 257);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(32, 16);
    gridSize = dim3(257, 513);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(16, 16);
    gridSize = dim3(513, 513);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
    /********************************
    addMatOnDevice1D
    *********************************/
    typeDevice = 2;

    blockSize = dim3(32, 1);
    gridSize = dim3(257, 1);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(64, 1);
    gridSize = dim3(129, 1);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(128, 1);
    gridSize = dim3(65, 1);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    /********************************
    addMatOnDevice2DNotMix
    *********************************/
    typeDevice = 3;

    blockSize = dim3(32, 1);
    gridSize = dim3(257, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(64, 1);
    gridSize = dim3(129, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(128, 1);
    gridSize = dim3(65, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(256, 1);
    gridSize = dim3(33, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(512, 1);
    gridSize = dim3(17, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(1024, 1);
    gridSize = dim3(9, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(2048, 1);
    gridSize = dim3(5, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    /********************************
    addMatOnDeviceMix
    *********************************/
    typeDevice = 4;

    blockSize = dim3(32, 1);
    gridSize = dim3(257, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(64, 1);
    gridSize = dim3(129, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(128, 1);
    gridSize = dim3(65, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(256, 1);
    gridSize = dim3(33, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(512, 1);
    gridSize = dim3(17, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(1024, 1);
    gridSize = dim3(9, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(2048, 1);
    gridSize = dim3(5, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
    
    free(in1);
    free(in2);
    free(out);

    return 0;
}
	.file	"tmpxft_0027cd21_00000000-6_calcTimeOnDevice.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3744:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3744:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0:
.LFB4450:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	pushq	%rax
	.cfi_def_cfa_offset 32
	call	strlen@PLT
	movq	8(%rbx), %rdx
	movq	%rbp, %rcx
	popq	%r9
	.cfi_def_cfa_offset 24
	movq	%rbx, %rdi
	movq	%rax, %r8
	popq	%rbx
	.cfi_def_cfa_offset 16
	xorl	%esi, %esi
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm@PLT
	.cfi_endproc
.LFE4450:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0
	.globl	_Z12addMatOnHostPfS_S_ii
	.type	_Z12addMatOnHostPfS_S_ii, @function
_Z12addMatOnHostPfS_S_ii:
.LFB3734:
	.cfi_startproc
	endbr64
	movq	%rdi, %r10
	movq	%rsi, %r11
	xorl	%edi, %edi
	xorl	%r9d, %r9d
.L5:
	cmpl	%r8d, %r9d
	jge	.L4
	movslq	%edi, %rax
	xorl	%esi, %esi
	salq	$2, %rax
.L8:
	cmpl	%ecx, %esi
	jge	.L10
	movss	(%r10,%rax), %xmm0
	addss	(%r11,%rax), %xmm0
	incl	%esi
	movss	%xmm0, (%rdx,%rax)
	addq	$4, %rax
	jmp	.L8
.L10:
	incl	%r9d
	addl	%ecx, %edi
	jmp	.L5
.L4:
	ret
	.cfi_endproc
.LFE3734:
	.size	_Z12addMatOnHostPfS_S_ii, .-_Z12addMatOnHostPfS_S_ii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\n"
.LC1:
	.string	"%f "
	.text
	.globl	_Z11printMatrixPfii
	.type	_Z11printMatrixPfii, @function
_Z11printMatrixPfii:
.LFB3735:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	movl	$2, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%esi, 12(%rsp)
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
.L12:
	cmpl	%ebx, %r13d
	jge	.L11
	movslq	%r12d, %rax
	xorl	%r15d, %r15d
	leaq	0(%rbp,%rax,4), %r14
.L15:
	cmpl	%r15d, 12(%rsp)
	jle	.L17
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%r14,%r15,4), %xmm0
	call	__printf_chk@PLT
	incq	%r15
	jmp	.L15
.L17:
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	incl	%r13d
	addl	%ebx, %r12d
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L12
.L11:
	addq	$24, %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
.LFE3735:
	.size	_Z11printMatrixPfii, .-_Z11printMatrixPfii
	.globl	_Z42__device_stub__Z16addMatOnDevice2DPfS_S_iiPfS_S_ii
	.type	_Z42__device_stub__Z16addMatOnDevice2DPfS_S_iiPfS_S_ii, @function
_Z42__device_stub__Z16addMatOnDevice2DPfS_S_iiPfS_S_ii:
.LFB3766:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16addMatOnDevice2DPfS_S_ii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L18:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3766:
	.size	_Z42__device_stub__Z16addMatOnDevice2DPfS_S_iiPfS_S_ii, .-_Z42__device_stub__Z16addMatOnDevice2DPfS_S_iiPfS_S_ii
	.globl	_Z16addMatOnDevice2DPfS_S_ii
	.type	_Z16addMatOnDevice2DPfS_S_ii, @function
_Z16addMatOnDevice2DPfS_S_ii:
.LFB3767:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z16addMatOnDevice2DPfS_S_iiPfS_S_ii
	.cfi_endproc
.LFE3767:
	.size	_Z16addMatOnDevice2DPfS_S_ii, .-_Z16addMatOnDevice2DPfS_S_ii
	.globl	_Z42__device_stub__Z16addMatOnDevice1DPfS_S_iiPfS_S_ii
	.type	_Z42__device_stub__Z16addMatOnDevice1DPfS_S_iiPfS_S_ii, @function
_Z42__device_stub__Z16addMatOnDevice1DPfS_S_iiPfS_S_ii:
.LFB3768:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L23
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16addMatOnDevice1DPfS_S_ii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L23:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3768:
	.size	_Z42__device_stub__Z16addMatOnDevice1DPfS_S_iiPfS_S_ii, .-_Z42__device_stub__Z16addMatOnDevice1DPfS_S_iiPfS_S_ii
	.globl	_Z16addMatOnDevice1DPfS_S_ii
	.type	_Z16addMatOnDevice1DPfS_S_ii, @function
_Z16addMatOnDevice1DPfS_S_ii:
.LFB3769:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z16addMatOnDevice1DPfS_S_iiPfS_S_ii
	.cfi_endproc
.LFE3769:
	.size	_Z16addMatOnDevice1DPfS_S_ii, .-_Z16addMatOnDevice1DPfS_S_ii
	.globl	_Z43__device_stub__Z17addMatOnDeviceMixPfS_S_iiPfS_S_ii
	.type	_Z43__device_stub__Z17addMatOnDeviceMixPfS_S_iiPfS_S_ii, @function
_Z43__device_stub__Z17addMatOnDeviceMixPfS_S_iiPfS_S_ii:
.LFB3770:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L28
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z17addMatOnDeviceMixPfS_S_ii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L28:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3770:
	.size	_Z43__device_stub__Z17addMatOnDeviceMixPfS_S_iiPfS_S_ii, .-_Z43__device_stub__Z17addMatOnDeviceMixPfS_S_iiPfS_S_ii
	.globl	_Z17addMatOnDeviceMixPfS_S_ii
	.type	_Z17addMatOnDeviceMixPfS_S_ii, @function
_Z17addMatOnDeviceMixPfS_S_ii:
.LFB3771:
	.cfi_startproc
	endbr64
	jmp	_Z43__device_stub__Z17addMatOnDeviceMixPfS_S_iiPfS_S_ii
	.cfi_endproc
.LFE3771:
	.size	_Z17addMatOnDeviceMixPfS_S_ii, .-_Z17addMatOnDeviceMixPfS_S_ii
	.section	.rodata.str1.1
.LC2:
	.string	""
.LC3:
	.string	"addMatOnDevice2D"
.LC4:
	.string	"addMatOnDevice1D"
.LC5:
	.string	"addMatOnDevice2DNotMix"
.LC6:
	.string	"addMatOnDeviceMix"
.LC7:
	.string	"%s|%d x %d\t|%d x %d\t|%d ms\t\n"
	.text
	.globl	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	.type	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i, @function
_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i:
.LFB3736:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3736
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	movq	%rdx, %r15
	pushq	%r14
	.cfi_offset 14, -32
	movq	%rdi, %r14
	leaq	-112(%rbp), %rdi
	pushq	%r13
	.cfi_offset 13, -40
	movq	%rsi, %r13
	pushq	%r12
	.cfi_offset 12, -48
	movl	%r8d, %r12d
	pushq	%rbx
	.cfi_offset 3, -56
	movl	%ecx, %ebx
	imull	%r8d, %ebx
	subq	$88, %rsp
	movl	%r9d, -120(%rbp)
	movl	%ecx, -116(%rbp)
	sall	$2, %ebx
	movslq	%ebx, %rbx
	movq	%rbx, %rsi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
.LEHB0:
	call	cudaMalloc@PLT
	leaq	-104(%rbp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	leaq	-96(%rbp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	-112(%rbp), %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	-104(%rbp), %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	leaq	-88(%rbp), %r13
	call	cudaMemcpy@PLT
.LEHE0:
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	leaq	.LC2(%rip), %rsi
	leaq	-72(%rbp), %rdi
	movq	%rsi, %rdx
	movq	%rax, %r14
	movq	%rdi, -88(%rbp)
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	-88(%rbp), %rax
	movl	-120(%rbp), %r9d
	xorl	%ecx, %ecx
	movq	%rcx, -80(%rbp)
	movb	$0, (%rax)
	cmpl	$1, %r9d
	jne	.L34
	leaq	.LC3(%rip), %rsi
.L53:
	movq	%r13, %rdi
.LEHB1:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0
	movl	24(%rbp), %ecx
	movq	16(%rbp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	32(%rbp), %rdi
	movl	40(%rbp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L48
.L37:
	call	cudaDeviceSynchronize@PLT
	jmp	.L54
.L34:
	cmpl	$2, %r9d
	jne	.L38
	leaq	.LC4(%rip), %rsi
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0
	movl	24(%rbp), %ecx
	movq	16(%rbp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	32(%rbp), %rdi
	movl	40(%rbp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L37
	movl	-116(%rbp), %ecx
	movq	-96(%rbp), %rdx
	movl	%r12d, %r8d
	movq	-104(%rbp), %rsi
	movq	-112(%rbp), %rdi
	call	_Z42__device_stub__Z16addMatOnDevice1DPfS_S_iiPfS_S_ii
	jmp	.L37
.L38:
	leaq	.LC5(%rip), %rsi
	cmpl	$3, %r9d
	jne	.L55
	jmp	.L53
.L48:
	movl	-116(%rbp), %ecx
	movq	-96(%rbp), %rdx
	movl	%r12d, %r8d
	movq	-104(%rbp), %rsi
	movq	-112(%rbp), %rdi
	call	_Z42__device_stub__Z16addMatOnDevice2DPfS_S_iiPfS_S_ii
	jmp	.L37
.L55:
	leaq	.LC6(%rip), %rsi
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0
	movl	24(%rbp), %ecx
	movq	16(%rbp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	32(%rbp), %rdi
	movl	40(%rbp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L37
	movl	-116(%rbp), %ecx
	movq	-96(%rbp), %rdx
	movl	%r12d, %r8d
	movq	-104(%rbp), %rsi
	movq	-112(%rbp), %rdi
	call	_Z43__device_stub__Z17addMatOnDeviceMixPfS_S_iiPfS_S_ii
	jmp	.L37
.L54:
	call	cudaGetLastError@PLT
	movq	-96(%rbp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdx
	movq	%r15, %rdi
	call	cudaMemcpy@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	$1000, %ecx
	movl	$2, %edi
	leaq	.LC7(%rip), %rsi
	subq	%r14, %rax
	cqto
	idivq	%rcx
	movq	-88(%rbp), %rdx
	pushq	%rax
	movl	36(%rbp), %eax
	pushq	%rax
	movl	32(%rbp), %r9d
	xorl	%eax, %eax
	movl	20(%rbp), %r8d
	movl	16(%rbp), %ecx
	.cfi_escape 0x2e,0x10
	call	__printf_chk@PLT
	movq	-112(%rbp), %rdi
	popq	%rax
	popq	%rdx
	.cfi_escape 0x2e,0
	call	cudaFree@PLT
	movq	-104(%rbp), %rdi
	call	cudaFree@PLT
	movq	-96(%rbp), %rdi
	call	cudaFree@PLT
.LEHE1:
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L42
	jmp	.L45
.L43:
	endbr64
	movq	%rax, %rbx
.L40:
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L45
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L45:
	call	__stack_chk_fail@PLT
.L42:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3736:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3736:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3736-.LLSDACSB3736
.LLSDACSB3736:
	.uleb128 .LEHB0-.LFB3736
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3736
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L43-.LFB3736
	.uleb128 0
	.uleb128 .LEHB2-.LFB3736
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE3736:
	.text
	.size	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i, .-_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	.section	.rodata.str1.1
.LC9:
	.string	"Function\t|Block size\t|Grid size\t|Time (ms)\n"
.LC10:
	.string	"addMatOnHost\t|\t\t|\t\t|%d\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3740:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$268500996, %edi
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	call	malloc@PLT
	movl	$268500996, %edi
	movq	%rax, %rbp
	call	malloc@PLT
	movl	$268500996, %edi
	movq	%rax, %rbx
	call	malloc@PLT
	xorl	%edi, %edi
	movq	%rax, %r12
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
.L57:
	xorl	%r13d, %r13d
.L58:
	call	rand@PLT
	movl	%eax, %edx
	leaq	0(%rbp,%r14), %rax
	cvtsi2ssl	%edx, %xmm0
	mulss	.LC8(%rip), %xmm0
	movss	%xmm0, (%rax,%r13)
	call	rand@PLT
	movl	%eax, %edx
	leaq	(%rbx,%r14), %rax
	cvtsi2ssl	%edx, %xmm0
	mulss	.LC8(%rip), %xmm0
	movss	%xmm0, (%rax,%r13)
	addq	$4, %r13
	cmpq	$32772, %r13
	jne	.L58
	addq	$32772, %r14
	cmpq	$268500996, %r14
	jne	.L57
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$8193, %r8d
	movl	$8193, %ecx
	movq	%rax, %r13
	call	_Z12addMatOnHostPfS_S_ii
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	$1000, %ecx
	movl	$2, %edi
	leaq	.LC9(%rip), %rsi
	subq	%r13, %rax
	cqto
	idivq	%rcx
	movq	%rax, %r14
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r14, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC10(%rip), %rsi
	call	__printf_chk@PLT
	subq	$32, %rsp
	.cfi_def_cfa_offset 112
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movabsq	$137438953504, %rax
	movl	$1, 48(%rsp)
	movabsq	$1103806595329, %rdx
	movl	$1, %r9d
	movq	%rdx, 52(%rsp)
	movl	$8193, %r8d
	movl	$8193, %ecx
	movq	%rax, 40(%rsp)
	movl	$1, 60(%rsp)
	movq	%rdx, 16(%rsp)
	movq	%r12, %rdx
	movq	%rax, (%rsp)
	movl	$1, 24(%rsp)
	movl	$1, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$513, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$1, %r9d
	movl	$16, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movl	$2147483649, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	salq	$5, %rax
	movl	$1, %r9d
	movl	$8193, %ecx
	movabsq	$2203318223105, %rdx
	movq	%rdx, 52(%rsp)
	movl	$8193, %r8d
	movq	%rdx, 16(%rsp)
	movl	60(%rsp), %edx
	movq	%rax, 40(%rsp)
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%edx, 24(%rsp)
	movq	%r12, %rdx
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$513, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$1, %r9d
	movl	$16, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movl	$134217729, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	salq	$5, %rax
	movl	$2, %r9d
	movl	$8193, %ecx
	movabsq	$4294967553, %rdx
	movq	%rdx, 52(%rsp)
	movl	$8193, %r8d
	movq	%rdx, 16(%rsp)
	movl	60(%rsp), %edx
	movq	%rax, 40(%rsp)
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%edx, 24(%rsp)
	movq	%r12, %rdx
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$129, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$2, %r9d
	movl	$64, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$65, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$2, %r9d
	movl	$128, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movabsq	$35188667056385, %rax
	movl	$32, 40(%rsp)
	movl	$8193, %ecx
	movl	$3, %r9d
	movq	%rax, 52(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$129, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$3, %r9d
	movl	$64, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$65, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$3, %r9d
	movl	$128, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$33, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$3, %r9d
	movl	$256, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$17, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$3, %r9d
	movl	$512, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$9, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$3, %r9d
	movl	$1024, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$5, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$3, %r9d
	movl	$2048, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$257, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$4, %r9d
	movl	$32, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$129, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$4, %r9d
	movl	$64, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$65, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$4, %r9d
	movl	$128, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$33, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$4, %r9d
	movl	$256, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$17, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$4, %r9d
	movl	$512, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movl	$9, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$8193, %ecx
	movl	$4, %r9d
	movl	$1024, 40(%rsp)
	movl	$8193, %r8d
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movl	$8193, %ecx
	movl	$4, %r9d
	movl	$8193, %r8d
	movq	%rbp, %rdi
	movl	$5, 52(%rsp)
	movq	52(%rsp), %rax
	movl	$2048, 40(%rsp)
	movq	%rax, 16(%rsp)
	movl	60(%rsp), %eax
	movl	%eax, 24(%rsp)
	movq	40(%rsp), %rax
	movq	%rax, (%rsp)
	movl	48(%rsp), %eax
	movl	%eax, 8(%rsp)
	call	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%rbp, %rdi
	call	free@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
.LFE3740:
	.size	main, .-main
	.section	.rodata.str1.1
.LC11:
	.string	"_Z17addMatOnDeviceMixPfS_S_ii"
.LC12:
	.string	"_Z16addMatOnDevice1DPfS_S_ii"
.LC13:
	.string	"_Z16addMatOnDevice2DPfS_S_ii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3773:
	.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	.LC11(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z17addMatOnDeviceMixPfS_S_ii(%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	.LC12(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16addMatOnDevice1DPfS_S_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC13(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16addMatOnDevice2DPfS_S_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	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
.LFE3773:
	.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
.LC8:
	.long	805306368
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.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 <hip/hip_runtime.h>
#include <stdio.h>
#include <stdlib.h>
#include <chrono>
#include <cmath>
#include <string>
#include <iostream>

using namespace std::chrono;
using namespace std;

__global__ void addMatOnDevice2D(float *in1, float *in2, float *out, int nx, int ny)
{
    int ix = threadIdx.x + blockIdx.x * blockDim.x;
    int iy = threadIdx.y + blockIdx.y * blockDim.y;
    if (ix < nx && iy < ny)
    {
        int i = iy * nx + ix;
        out[i] = in1[i] + in2[i];
    }
}

__global__ void addMatOnDevice1D(float *in1, float *in2, float *out, int nx, int ny)
{
    int ix = threadIdx.x + blockIdx.x * blockDim.x;
    if (ix < nx)
    {
        for (int iy = 0; iy < ny; iy++)
        {
            int idx = iy * nx + ix;
            out[idx] = in1[idx] + in2[idx];
        }
    }
}

__global__ void addMatOnDeviceMix(float *in1, float *in2, float *out, int nx, int ny)
{
    int ix = threadIdx.x + blockIdx.x * blockDim.x;
    int iy = blockIdx.y;
    if (ix < nx)
    {
        int idx = iy * nx + ix;
        out[idx] = in1[idx] + in2[idx];
    }
}

void addMatOnHost(float *in1, float *in2, float *out,
                  int nx, int ny)
{
    for (int i = 0; i < ny; i++)
        for (int j = 0; j < nx; j++){
            int idx = i * nx + j;
            out[idx] = in1[idx] + in2[idx];
        }
}

void printMatrix(float *matrix, int nx, int ny)
{
    printf("\n");
    for (int i = 0; i < ny; i++){
        for (int j = 0; j < nx; j++){
            int idx = i * ny + j;
            printf("%f ", matrix[idx]);
        }
        printf("\n");
    }
}

void calcTimeOnDevice(float *in1, float *in2, float *out, int nx, int ny, dim3 blockSize, dim3 gridSize, int typeDevice)
{
    int size = nx * ny * sizeof(float);

    // Allocate vector to device memory
    float *d_in1, *d_in2, *d_out;
    hipMalloc(&d_in1, size);
    hipMalloc(&d_in2, size);
    hipMalloc(&d_out, size);

    // Copy inputs to device
    hipMemcpy(d_in1, in1, size, hipMemcpyHostToDevice);
    hipMemcpy(d_in2, in2, size, hipMemcpyHostToDevice);

    auto start_device = high_resolution_clock::now();
    string deviceName = "";
    if (typeDevice == 1){
        deviceName = "addMatOnDevice2D";
        addMatOnDevice2D<<<gridSize, blockSize>>>(d_in1, d_in2, d_out, nx, ny);
    }else if (typeDevice == 2){
        deviceName = "addMatOnDevice1D";
        addMatOnDevice1D<<<gridSize, blockSize>>>(d_in1, d_in2, d_out, nx, ny);
    }else if (typeDevice == 3){
        deviceName = "addMatOnDevice2DNotMix";
        addMatOnDevice2D<<<gridSize, blockSize>>>(d_in1, d_in2, d_out, nx, ny);
    }else {
        deviceName = "addMatOnDeviceMix";
        addMatOnDeviceMix<<<gridSize, blockSize>>>(d_in1, d_in2, d_out, nx, ny);
    }
    
    hipDeviceSynchronize();
    hipGetLastError();
    hipMemcpy(out, d_out, size, hipMemcpyDeviceToHost);
    auto stop_device = high_resolution_clock::now();
    auto duration_device = duration_cast<microseconds>(stop_device - start_device);
    auto duration = duration_device.count();
 
    printf("%s|%d x %d\t|%d x %d\t|%d ms\t\n", deviceName.c_str(), blockSize.x, blockSize.y, gridSize.x, gridSize.y, duration);

     // Cleanup
    hipFree(d_in1);
    hipFree(d_in2);
    hipFree(d_out);
}


int main()
{
    int nx, ny;       // Số cột và số dòng
    float *in1, *in2; // input matrix
    float *out;       // output vector

    nx = pow(2, 13) + 1;
    ny = pow(2, 13) + 1;

    int size = nx * ny * sizeof(float);

    in1 = (float *)malloc(size);
    in2 = (float *)malloc(size);
    out = (float *)malloc(size);

    // Setup input values
    srand(time(0));
    for (int i = 0; i < ny; i++){
        for (int j = 0; j < nx; j++){
            int idx = i * ny + j;
            in1[idx] = static_cast<float>(rand()) / static_cast<float>(RAND_MAX);
            in2[idx] = static_cast<float>(rand()) / static_cast<float>(RAND_MAX);
        }
    }

    auto start_host = high_resolution_clock::now();
    addMatOnHost(in1, in2, out, nx, ny);
    auto stop_host = high_resolution_clock::now();
    auto duration_host = duration_cast<microseconds>(stop_host - start_host);
    printf("Function\t|Block size\t|Grid size\t|Time (ms)\n");
    printf("addMatOnHost\t|\t\t|\t\t|%d\n", duration_host.count());


    /********************************
    addMatOnDevice2D
    *********************************/
    int typeDevice = 1;

    dim3 blockSize(32, 32);
    dim3 gridSize(257, 257);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(16, 32);
    gridSize = dim3(513, 257);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(32, 16);
    gridSize = dim3(257, 513);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(16, 16);
    gridSize = dim3(513, 513);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
    /********************************
    addMatOnDevice1D
    *********************************/
    typeDevice = 2;

    blockSize = dim3(32, 1);
    gridSize = dim3(257, 1);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(64, 1);
    gridSize = dim3(129, 1);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(128, 1);
    gridSize = dim3(65, 1);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    /********************************
    addMatOnDevice2DNotMix
    *********************************/
    typeDevice = 3;

    blockSize = dim3(32, 1);
    gridSize = dim3(257, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(64, 1);
    gridSize = dim3(129, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(128, 1);
    gridSize = dim3(65, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(256, 1);
    gridSize = dim3(33, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(512, 1);
    gridSize = dim3(17, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(1024, 1);
    gridSize = dim3(9, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(2048, 1);
    gridSize = dim3(5, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    /********************************
    addMatOnDeviceMix
    *********************************/
    typeDevice = 4;

    blockSize = dim3(32, 1);
    gridSize = dim3(257, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(64, 1);
    gridSize = dim3(129, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(128, 1);
    gridSize = dim3(65, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(256, 1);
    gridSize = dim3(33, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(512, 1);
    gridSize = dim3(17, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);

    blockSize = dim3(1024, 1);
    gridSize = dim3(9, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
 
    blockSize = dim3(2048, 1);
    gridSize = dim3(5, 8193);
    calcTimeOnDevice(in1, in2, out, nx, ny, blockSize, gridSize, typeDevice);
    
    free(in1);
    free(in2);
    free(out);

    return 0;
}
	.text
	.file	"calcTimeOnDevice.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z31__device_stub__addMatOnDevice2DPfS_S_ii # -- Begin function _Z31__device_stub__addMatOnDevice2DPfS_S_ii
	.type	_Z31__device_stub__addMatOnDevice2DPfS_S_ii,@function
_Z31__device_stub__addMatOnDevice2DPfS_S_ii: # @_Z31__device_stub__addMatOnDevice2DPfS_S_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%rsp), %rdx
	movl	%ecx, (%rdx)
	movq	%rsp, %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z16addMatOnDevice2DPfS_S_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z31__device_stub__addMatOnDevice2DPfS_S_ii, .Lfunc_end0-_Z31__device_stub__addMatOnDevice2DPfS_S_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z31__device_stub__addMatOnDevice1DPfS_S_ii # -- Begin function _Z31__device_stub__addMatOnDevice1DPfS_S_ii
	.type	_Z31__device_stub__addMatOnDevice1DPfS_S_ii,@function
_Z31__device_stub__addMatOnDevice1DPfS_S_ii: # @_Z31__device_stub__addMatOnDevice1DPfS_S_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%rsp), %rdx
	movl	%ecx, (%rdx)
	movq	%rsp, %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z16addMatOnDevice1DPfS_S_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z31__device_stub__addMatOnDevice1DPfS_S_ii, .Lfunc_end1-_Z31__device_stub__addMatOnDevice1DPfS_S_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z32__device_stub__addMatOnDeviceMixPfS_S_ii # -- Begin function _Z32__device_stub__addMatOnDeviceMixPfS_S_ii
	.type	_Z32__device_stub__addMatOnDeviceMixPfS_S_ii,@function
_Z32__device_stub__addMatOnDeviceMixPfS_S_ii: # @_Z32__device_stub__addMatOnDeviceMixPfS_S_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%rsp), %rdx
	movl	%ecx, (%rdx)
	movq	%rsp, %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z17addMatOnDeviceMixPfS_S_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z32__device_stub__addMatOnDeviceMixPfS_S_ii, .Lfunc_end2-_Z32__device_stub__addMatOnDeviceMixPfS_S_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z12addMatOnHostPfS_S_ii        # -- Begin function _Z12addMatOnHostPfS_S_ii
	.type	_Z12addMatOnHostPfS_S_ii,@function
_Z12addMatOnHostPfS_S_ii:               # @_Z12addMatOnHostPfS_S_ii
	.cfi_startproc
# %bb.0:
	testl	%r8d, %r8d
	jle	.LBB3_7
# %bb.1:                                # %.preheader.lr.ph
	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
	movl	%r8d, %eax
	movl	%ecx, %r8d
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
.LBB3_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
	testl	%ecx, %ecx
	jle	.LBB3_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	%r9d, %r14d
	leaq	(%rdx,%r14,4), %r11
	leaq	(%rsi,%r14,4), %rbx
	leaq	(%rdi,%r14,4), %r14
	xorl	%r15d, %r15d
.LBB3_4:                                #   Parent Loop BB3_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r14,%r15,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	addss	(%rbx,%r15,4), %xmm0
	movss	%xmm0, (%r11,%r15,4)
	incq	%r15
	cmpq	%r15, %r8
	jne	.LBB3_4
.LBB3_5:                                # %._crit_edge
                                        #   in Loop: Header=BB3_2 Depth=1
	incq	%r10
	addl	%ecx, %r9d
	cmpq	%rax, %r10
	jne	.LBB3_2
# %bb.6:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB3_7:                                # %._crit_edge18
	retq
.Lfunc_end3:
	.size	_Z12addMatOnHostPfS_S_ii, .Lfunc_end3-_Z12addMatOnHostPfS_S_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z11printMatrixPfii             # -- Begin function _Z11printMatrixPfii
	.type	_Z11printMatrixPfii,@function
_Z11printMatrixPfii:                    # @_Z11printMatrixPfii
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebx
	movl	%esi, 4(%rsp)                   # 4-byte Spill
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	movl	$10, %edi
	callq	putchar@PLT
	testl	%ebx, %ebx
	jle	.LBB4_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%ebx, %r15d
	movl	%ebx, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	4(%rsp), %r12d                  # 4-byte Reload
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
.LBB4_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_4 Depth 2
	cmpl	$0, 4(%rsp)                     # 4-byte Folded Reload
	jle	.LBB4_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB4_2 Depth=1
	movl	%r13d, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %rbp
	xorl	%ebx, %ebx
.LBB4_4:                                #   Parent Loop BB4_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbp,%rbx,4), %xmm0
	movl	$.L.str.1, %edi
	movb	$1, %al
	callq	printf
	incq	%rbx
	cmpq	%rbx, %r12
	jne	.LBB4_4
.LBB4_5:                                # %._crit_edge
                                        #   in Loop: Header=BB4_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%r14
	addl	%r15d, %r13d
	cmpq	16(%rsp), %r14                  # 8-byte Folded Reload
	jne	.LBB4_2
.LBB4_6:                                # %._crit_edge15
	addq	$24, %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_end4:
	.size	_Z11printMatrixPfii, .Lfunc_end4-_Z11printMatrixPfii
	.cfi_endproc
                                        # -- End function
	.globl	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i # -- Begin function _Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	.type	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i,@function
_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i:  # @_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	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
	movl	%r9d, %ebx
	movq	%rdx, 80(%rsp)                  # 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r13
	movl	%ecx, 16(%rsp)                  # 4-byte Spill
	movl	%ecx, %eax
	movl	%r8d, 20(%rsp)                  # 4-byte Spill
	imull	%r8d, %eax
	shll	$2, %eax
	movslq	%eax, %r14
	leaq	40(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	32(%rsp), %r12
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	24(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	(%rbp), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r12), %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	leaq	64(%rsp), %rbp
	movq	%rbp, -16(%rbp)
	leaq	48(%rsp), %r12
	movl	$.L.str.2, %esi
	movl	$.L.str.2, %edx
	movq	%r12, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movq	8(%r12), %rdx
	cmpl	$3, %ebx
	je	.LBB5_12
# %bb.1:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	cmpl	$2, %ebx
	je	.LBB5_8
# %bb.2:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	cmpl	$1, %ebx
	jne	.LBB5_16
# %bb.3:
.Ltmp12:
	leaq	48(%rsp), %rdi
	movl	$.L.str.3, %ecx
	movl	$16, %r8d
	xorl	%esi, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
.Ltmp13:
# %bb.4:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.exit
	leaq	160(%rsp), %rax
	movq	(%rax), %r13
	movl	8(%rax), %esi
	leaq	144(%rsp), %rax
	movq	(%rax), %rbx
	movl	8(%rax), %ecx
.Ltmp14:
	movq	%r13, %rdi
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp15:
# %bb.5:
	testl	%eax, %eax
	jne	.LBB5_20
# %bb.6:
	movq	40(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
.Ltmp16:
	movl	16(%rsp), %ecx                  # 4-byte Reload
	movl	20(%rsp), %r8d                  # 4-byte Reload
	callq	_Z31__device_stub__addMatOnDevice2DPfS_S_ii
.Ltmp17:
	jmp	.LBB5_20
.LBB5_8:
.Ltmp6:
	leaq	48(%rsp), %rdi
	movl	$.L.str.4, %ecx
	movl	$16, %r8d
	xorl	%esi, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
.Ltmp7:
# %bb.9:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.exit64
	leaq	160(%rsp), %rax
	movq	(%rax), %r13
	movl	8(%rax), %esi
	leaq	144(%rsp), %rax
	movq	(%rax), %rbx
	movl	8(%rax), %ecx
.Ltmp8:
	movq	%r13, %rdi
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp9:
# %bb.10:
	testl	%eax, %eax
	jne	.LBB5_20
# %bb.11:
	movq	40(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
.Ltmp10:
	movl	16(%rsp), %ecx                  # 4-byte Reload
	movl	20(%rsp), %r8d                  # 4-byte Reload
	callq	_Z31__device_stub__addMatOnDevice1DPfS_S_ii
.Ltmp11:
	jmp	.LBB5_20
.LBB5_12:
.Ltmp0:
	leaq	48(%rsp), %rdi
	movl	$.L.str.5, %ecx
	movl	$22, %r8d
	xorl	%esi, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
.Ltmp1:
# %bb.13:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.exit65
	leaq	160(%rsp), %rax
	movq	(%rax), %r13
	movl	8(%rax), %esi
	leaq	144(%rsp), %rax
	movq	(%rax), %rbx
	movl	8(%rax), %ecx
.Ltmp2:
	movq	%r13, %rdi
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp3:
# %bb.14:
	testl	%eax, %eax
	jne	.LBB5_20
# %bb.15:
	movq	40(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
.Ltmp4:
	movl	16(%rsp), %ecx                  # 4-byte Reload
	movl	20(%rsp), %r8d                  # 4-byte Reload
	callq	_Z31__device_stub__addMatOnDevice2DPfS_S_ii
.Ltmp5:
	jmp	.LBB5_20
.LBB5_16:
.Ltmp18:
	leaq	48(%rsp), %rdi
	movl	$.L.str.6, %ecx
	movl	$17, %r8d
	xorl	%esi, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
.Ltmp19:
# %bb.17:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.exit66
	leaq	160(%rsp), %rax
	movq	(%rax), %r13
	movl	8(%rax), %esi
	leaq	144(%rsp), %rax
	movq	(%rax), %rbx
	movl	8(%rax), %ecx
.Ltmp20:
	movq	%r13, %rdi
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp21:
# %bb.18:
	testl	%eax, %eax
	jne	.LBB5_20
# %bb.19:
	movq	40(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
.Ltmp22:
	movl	16(%rsp), %ecx                  # 4-byte Reload
	movl	20(%rsp), %r8d                  # 4-byte Reload
	callq	_Z32__device_stub__addMatOnDeviceMixPfS_S_ii
.Ltmp23:
.LBB5_20:
.Ltmp24:
	callq	hipDeviceSynchronize
.Ltmp25:
# %bb.21:
.Ltmp26:
	callq	hipGetLastError
.Ltmp27:
# %bb.22:
	movq	24(%rsp), %rsi
.Ltmp28:
	movq	80(%rsp), %rdi                  # 8-byte Reload
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp29:
# %bb.23:
	movq	%rbx, %r14
	shrq	$32, %r14
	movq	%r13, %r12
	shrq	$32, %r12
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	imulq	%rcx
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rdx
	addq	%rax, %rdx
	movq	48(%rsp), %rsi
	movq	%rdx, (%rsp)
	movl	$.L.str.7, %edi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	movl	%r13d, %r8d
	movl	%r12d, %r9d
	xorl	%eax, %eax
	callq	printf
	movq	40(%rsp), %rdi
.Ltmp31:
	callq	hipFree
.Ltmp32:
# %bb.24:
	movq	32(%rsp), %rdi
.Ltmp33:
	callq	hipFree
.Ltmp34:
# %bb.25:
	movq	24(%rsp), %rdi
.Ltmp35:
	callq	hipFree
.Ltmp36:
# %bb.26:
	movq	48(%rsp), %rdi
	cmpq	%rbp, %rdi
	je	.LBB5_28
# %bb.27:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB5_28:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	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_29:
	.cfi_def_cfa_offset 144
.Ltmp37:
	jmp	.LBB5_30
.LBB5_7:
.Ltmp30:
.LBB5_30:
	movq	%rax, %rbx
	movq	48(%rsp), %rdi
	cmpq	%rbp, %rdi
	je	.LBB5_32
# %bb.31:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i67
	callq	_ZdlPv
.LBB5_32:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit69
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end5:
	.size	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i, .Lfunc_end5-_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table5:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp12-.Lfunc_begin0          #   Call between .Lfunc_begin0 and .Ltmp12
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 2 <<
	.uleb128 .Ltmp29-.Ltmp12                #   Call between .Ltmp12 and .Ltmp29
	.uleb128 .Ltmp30-.Lfunc_begin0          #     jumps to .Ltmp30
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp31-.Lfunc_begin0          # >> Call Site 3 <<
	.uleb128 .Ltmp36-.Ltmp31                #   Call between .Ltmp31 and .Ltmp36
	.uleb128 .Ltmp37-.Lfunc_begin0          #     jumps to .Ltmp37
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp36-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Lfunc_end5-.Ltmp36            #   Call between .Ltmp36 and .Lfunc_end5
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI6_0:
	.long	0x30000000                      # float 4.65661287E-10
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$696, %rsp                      # imm = 0x2B8
	.cfi_def_cfa_offset 752
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$268500996, %edi                # imm = 0x10010004
	callq	malloc
	movq	%rax, %rbp
	movl	$268500996, %edi                # imm = 0x10010004
	callq	malloc
	movq	%rax, %r15
	movl	$268500996, %edi                # imm = 0x10010004
	callq	malloc
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	movl	$32772, %r13d                   # imm = 0x8004
	movq	%rbp, 352(%rsp)                 # 8-byte Spill
	movq	%r15, %r14
.LBB6_1:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_2 Depth 2
	xorl	%ebx, %ebx
.LBB6_2:                                #   Parent Loop BB6_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI6_0(%rip), %xmm0
	movss	%xmm0, (%rbp,%rbx,4)
	callq	rand
	movss	.LCPI6_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	%xmm1, %xmm0
	movss	%xmm0, (%r14,%rbx,4)
	incq	%rbx
	cmpq	$8193, %rbx                     # imm = 0x2001
	jne	.LBB6_2
# %bb.3:                                #   in Loop: Header=BB6_1 Depth=1
	incq	%r12
	addq	%r13, %r14
	addq	%r13, %rbp
	cmpq	$8193, %r12                     # imm = 0x2001
	jne	.LBB6_1
# %bb.4:                                # %.preheader.lr.ph.i
	xorl	%r14d, %r14d
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r12
	movl	$32772, %eax                    # imm = 0x8004
	movq	352(%rsp), %rbx                 # 8-byte Reload
	movq	%rbx, %rcx
	movq	%r15, %rdx
	movq	8(%rsp), %rsi                   # 8-byte Reload
.LBB6_5:                                # %.lr.ph.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_6 Depth 2
	xorl	%edi, %edi
.LBB6_6:                                #   Parent Loop BB6_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rcx,%rdi,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	addss	(%rdx,%rdi,4), %xmm0
	movss	%xmm0, (%rsi,%rdi,4)
	incq	%rdi
	cmpq	$8193, %rdi                     # imm = 0x2001
	jne	.LBB6_6
# %bb.7:                                # %._crit_edge.i
                                        #   in Loop: Header=BB6_5 Depth=1
	incq	%r14
	addq	%rax, %rsi
	addq	%rax, %rdx
	addq	%rax, %rcx
	cmpq	$8193, %r14                     # imm = 0x2001
	jne	.LBB6_5
# %bb.8:                                # %_Z12addMatOnHostPfS_S_ii.exit
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r12, %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	imulq	%rcx
	movq	%rdx, %r12
	shrq	$63, %r12
	sarq	$7, %rdx
	addq	%rdx, %r12
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$.L.str.9, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	printf
	movabsq	$137438953504, %rax             # imm = 0x2000000020
	movq	%rax, 336(%rsp)
	movl	$1, %r12d
	movl	%r12d, 344(%rsp)
	movabsq	$1103806595329, %rax            # imm = 0x10100000101
	movq	%rax, 680(%rsp)
	movl	%r12d, 688(%rsp)
	movq	680(%rsp), %rax
	movl	344(%rsp), %r10d
	movq	336(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	8(%rsp), %r14                   # 8-byte Reload
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$1, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$137438953488, %rax             # imm = 0x2000000010
	movq	%rax, 320(%rsp)
	movl	%r12d, 328(%rsp)
	movabsq	$1103806595585, %rax            # imm = 0x10100000201
	movq	%rax, 664(%rsp)
	movl	%r12d, 672(%rsp)
	movq	664(%rsp), %rax
	movl	328(%rsp), %r10d
	movq	320(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$1, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$68719476768, %rax              # imm = 0x1000000020
	movq	%rax, 304(%rsp)
	movl	%r12d, 312(%rsp)
	movabsq	$2203318223105, %rax            # imm = 0x20100000101
	movq	%rax, 648(%rsp)
	movl	%r12d, 656(%rsp)
	movq	648(%rsp), %rax
	movl	312(%rsp), %r10d
	movq	304(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$1, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$68719476752, %rax              # imm = 0x1000000010
	movq	%rax, 288(%rsp)
	movl	%r12d, 296(%rsp)
	movabsq	$2203318223361, %rax            # imm = 0x20100000201
	movq	%rax, 632(%rsp)
	movl	%r12d, 640(%rsp)
	movq	632(%rsp), %rax
	movl	296(%rsp), %r10d
	movq	288(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$1, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967328, %rax               # imm = 0x100000020
	movq	%rax, 272(%rsp)
	movl	%r12d, 280(%rsp)
	movabsq	$4294967553, %rax               # imm = 0x100000101
	movq	%rax, 616(%rsp)
	movl	%r12d, 624(%rsp)
	movq	616(%rsp), %rax
	movl	280(%rsp), %r10d
	movq	272(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$2, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967360, %rax               # imm = 0x100000040
	movq	%rax, 256(%rsp)
	movq	%rax, %rbp
	movl	%r12d, 264(%rsp)
	movabsq	$4294967425, %rax               # imm = 0x100000081
	movq	%rax, 600(%rsp)
	movl	%r12d, 608(%rsp)
	movq	600(%rsp), %rax
	movl	264(%rsp), %r10d
	movq	256(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$2, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967424, %r13               # imm = 0x100000080
	movq	%r13, 240(%rsp)
	movl	%r12d, 248(%rsp)
	movabsq	$4294967361, %rax               # imm = 0x100000041
	movq	%rax, 584(%rsp)
	movl	%r12d, 592(%rsp)
	movq	584(%rsp), %rax
	movl	248(%rsp), %r10d
	movq	240(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$2, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967328, %rax               # imm = 0x100000020
	movq	%rax, 224(%rsp)
	movl	%r12d, 232(%rsp)
	movabsq	$35188667056385, %rax           # imm = 0x200100000101
	movq	%rax, 568(%rsp)
	movl	%r12d, 576(%rsp)
	movq	568(%rsp), %rax
	movl	232(%rsp), %r10d
	movq	224(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$3, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movq	%rbp, 208(%rsp)
	movl	%r12d, 216(%rsp)
	movabsq	$35188667056257, %rax           # imm = 0x200100000081
	movq	%rax, 552(%rsp)
	movl	%r12d, 560(%rsp)
	movq	552(%rsp), %rax
	movl	216(%rsp), %r10d
	movq	208(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$3, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movq	%r13, 192(%rsp)
	movl	%r12d, 200(%rsp)
	movabsq	$35188667056193, %rax           # imm = 0x200100000041
	movq	%rax, 536(%rsp)
	movl	%r12d, 544(%rsp)
	movq	536(%rsp), %rax
	movl	200(%rsp), %r10d
	movq	192(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$3, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967552, %rax               # imm = 0x100000100
	movq	%rax, 176(%rsp)
	movl	%r12d, 184(%rsp)
	movabsq	$35188667056161, %rax           # imm = 0x200100000021
	movq	%rax, 520(%rsp)
	movl	%r12d, 528(%rsp)
	movq	520(%rsp), %rax
	movl	184(%rsp), %r10d
	movq	176(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$3, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967808, %rax               # imm = 0x100000200
	movq	%rax, 160(%rsp)
	movl	%r12d, 168(%rsp)
	movabsq	$35188667056145, %rax           # imm = 0x200100000011
	movq	%rax, 504(%rsp)
	movl	%r12d, 512(%rsp)
	movq	504(%rsp), %rax
	movl	168(%rsp), %r10d
	movq	160(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$3, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294968320, %rax               # imm = 0x100000400
	movq	%rax, 144(%rsp)
	movl	%r12d, 152(%rsp)
	movabsq	$35188667056137, %rax           # imm = 0x200100000009
	movq	%rax, 488(%rsp)
	movl	%r12d, 496(%rsp)
	movq	488(%rsp), %rax
	movl	152(%rsp), %r10d
	movq	144(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$3, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294969344, %r13               # imm = 0x100000800
	movq	%r13, 128(%rsp)
	movl	%r12d, 136(%rsp)
	movabsq	$35188667056133, %rbp           # imm = 0x200100000005
	movq	%rbp, 472(%rsp)
	movl	%r12d, 480(%rsp)
	movq	472(%rsp), %rax
	movl	136(%rsp), %r10d
	movq	128(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$3, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967328, %rax               # imm = 0x100000020
	movq	%rax, 112(%rsp)
	movl	%r12d, 120(%rsp)
	movabsq	$35188667056385, %rax           # imm = 0x200100000101
	movq	%rax, 456(%rsp)
	movl	%r12d, 464(%rsp)
	movq	456(%rsp), %rax
	movl	120(%rsp), %r10d
	movq	112(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$4, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967360, %rax               # imm = 0x100000040
	movq	%rax, 96(%rsp)
	movl	%r12d, 104(%rsp)
	movabsq	$35188667056257, %rax           # imm = 0x200100000081
	movq	%rax, 440(%rsp)
	movl	%r12d, 448(%rsp)
	movq	440(%rsp), %rax
	movl	104(%rsp), %r10d
	movq	96(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$4, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967424, %rax               # imm = 0x100000080
	movq	%rax, 80(%rsp)
	movl	%r12d, 88(%rsp)
	movabsq	$35188667056193, %rax           # imm = 0x200100000041
	movq	%rax, 424(%rsp)
	movl	%r12d, 432(%rsp)
	movq	424(%rsp), %rax
	movl	88(%rsp), %r10d
	movq	80(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$4, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967552, %rax               # imm = 0x100000100
	movq	%rax, 64(%rsp)
	movl	%r12d, 72(%rsp)
	movabsq	$35188667056161, %rax           # imm = 0x200100000021
	movq	%rax, 408(%rsp)
	movl	%r12d, 416(%rsp)
	movq	408(%rsp), %rax
	movl	72(%rsp), %r10d
	movq	64(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$4, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294967808, %rax               # imm = 0x100000200
	movq	%rax, 48(%rsp)
	movl	%r12d, 56(%rsp)
	movabsq	$35188667056145, %rax           # imm = 0x200100000011
	movq	%rax, 392(%rsp)
	movl	%r12d, 400(%rsp)
	movq	392(%rsp), %rax
	movl	56(%rsp), %r10d
	movq	48(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$4, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movabsq	$4294968320, %rax               # imm = 0x100000400
	movq	%rax, 32(%rsp)
	movl	%r12d, 40(%rsp)
	movabsq	$35188667056137, %rax           # imm = 0x200100000009
	movq	%rax, 376(%rsp)
	movl	%r12d, 384(%rsp)
	movq	376(%rsp), %rax
	movl	40(%rsp), %r10d
	movq	32(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$4, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movq	%r13, 16(%rsp)
	movl	%r12d, 24(%rsp)
	movq	%rbp, 360(%rsp)
	movl	%r12d, 368(%rsp)
	movq	360(%rsp), %rax
	movl	24(%rsp), %r10d
	movq	16(%rsp), %r11
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$8193, %ecx                     # imm = 0x2001
	movl	$8193, %r8d                     # imm = 0x2001
	movl	$4, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	callq	_Z16calcTimeOnDevicePfS_S_ii4dim3S0_i
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movq	%rbx, %rdi
	callq	free
	movq	%r15, %rdi
	callq	free
	movq	%r14, %rdi
	callq	free
	xorl	%eax, %eax
	addq	$696, %rsp                      # imm = 0x2B8
	.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	main, .Lfunc_end6-main
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.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 %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB7_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB7_3
.LBB7_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB7_3:
	testq	%r14, %r14
	je	.LBB7_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB7_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB7_7
.LBB7_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB7_7:                                # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end7-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB8_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB8_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z16addMatOnDevice2DPfS_S_ii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z16addMatOnDevice1DPfS_S_ii, %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	$_Z17addMatOnDeviceMixPfS_S_ii, %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_end8:
	.size	__hip_module_ctor, .Lfunc_end8-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB9_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB9_2:
	retq
.Lfunc_end9:
	.size	__hip_module_dtor, .Lfunc_end9-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z16addMatOnDevice2DPfS_S_ii,@object # @_Z16addMatOnDevice2DPfS_S_ii
	.section	.rodata,"a",@progbits
	.globl	_Z16addMatOnDevice2DPfS_S_ii
	.p2align	3, 0x0
_Z16addMatOnDevice2DPfS_S_ii:
	.quad	_Z31__device_stub__addMatOnDevice2DPfS_S_ii
	.size	_Z16addMatOnDevice2DPfS_S_ii, 8

	.type	_Z16addMatOnDevice1DPfS_S_ii,@object # @_Z16addMatOnDevice1DPfS_S_ii
	.globl	_Z16addMatOnDevice1DPfS_S_ii
	.p2align	3, 0x0
_Z16addMatOnDevice1DPfS_S_ii:
	.quad	_Z31__device_stub__addMatOnDevice1DPfS_S_ii
	.size	_Z16addMatOnDevice1DPfS_S_ii, 8

	.type	_Z17addMatOnDeviceMixPfS_S_ii,@object # @_Z17addMatOnDeviceMixPfS_S_ii
	.globl	_Z17addMatOnDeviceMixPfS_S_ii
	.p2align	3, 0x0
_Z17addMatOnDeviceMixPfS_S_ii:
	.quad	_Z32__device_stub__addMatOnDeviceMixPfS_S_ii
	.size	_Z17addMatOnDeviceMixPfS_S_ii, 8

	.type	.L.str.1,@object                # @.str.1
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.1:
	.asciz	"%f "
	.size	.L.str.1, 4

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.zero	1
	.size	.L.str.2, 1

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

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"addMatOnDevice2DNotMix"
	.size	.L.str.5, 23

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"addMatOnDeviceMix"
	.size	.L.str.6, 18

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"%s|%d x %d\t|%d x %d\t|%d ms\t\n"
	.size	.L.str.7, 29

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"addMatOnHost\t|\t\t|\t\t|%d\n"
	.size	.L.str.9, 24

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z16addMatOnDevice2DPfS_S_ii"
	.size	.L__unnamed_1, 29

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

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z17addMatOnDeviceMixPfS_S_ii"
	.size	.L__unnamed_3, 30

	.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	"Function\t|Block size\t|Grid size\t|Time (ms)"
	.size	.Lstr, 43

	.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 _Z31__device_stub__addMatOnDevice2DPfS_S_ii
	.addrsig_sym _Z31__device_stub__addMatOnDevice1DPfS_S_ii
	.addrsig_sym _Z32__device_stub__addMatOnDeviceMixPfS_S_ii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z16addMatOnDevice2DPfS_S_ii
	.addrsig_sym _Z16addMatOnDevice1DPfS_S_ii
	.addrsig_sym _Z17addMatOnDeviceMixPfS_S_ii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z16addMatOnDevice2DPfS_S_ii ; -- Begin function _Z16addMatOnDevice2DPfS_S_ii
	.globl	_Z16addMatOnDevice2DPfS_S_ii
	.p2align	8
	.type	_Z16addMatOnDevice2DPfS_S_ii,@function
_Z16addMatOnDevice2DPfS_S_ii:           ; @_Z16addMatOnDevice2DPfS_S_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b64 s[4:5], s[0:1], 0x18
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v3, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_mad_u64_u32 v[1:2], null, s15, s3, v[3:4]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, s4, v0
	v_cmp_gt_i32_e64 s2, s5, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b128 s[8:11], s[0:1], 0x0
	v_mad_u64_u32 v[2:3], null, v1, s4, v[0:1]
	s_load_b64 s[0:1], s[0:1], 0x10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[0:1], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s8, v0
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v1, vcc_lo
	v_add_co_u32 v4, vcc_lo, s10, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s11, v1, vcc_lo
	v_add_co_u32 v0, vcc_lo, s0, v0
	global_load_b32 v2, v[2:3], off
	global_load_b32 v3, v[4:5], off
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v2, v2, v3
	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 _Z16addMatOnDevice2DPfS_S_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 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_end0:
	.size	_Z16addMatOnDevice2DPfS_S_ii, .Lfunc_end0-_Z16addMatOnDevice2DPfS_S_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 232
; 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	_Z16addMatOnDevice1DPfS_S_ii ; -- Begin function _Z16addMatOnDevice1DPfS_S_ii
	.globl	_Z16addMatOnDevice1DPfS_S_ii
	.p2align	8
	.type	_Z16addMatOnDevice1DPfS_S_ii,@function
_Z16addMatOnDevice1DPfS_S_ii:           ; @_Z16addMatOnDevice1DPfS_S_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x2c
	s_load_b64 s[2:3], s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_cmp_gt_i32 s3, 0
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	s_cselect_b32 s4, -1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_gt_i32_e32 vcc_lo, s2, v1
	s_and_b32 s4, vcc_lo, s4
	s_and_saveexec_b32 s5, s4
	s_cbranch_execz .LBB1_3
; %bb.1:                                ; %.lr.ph.preheader
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
.LBB1_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	v_ashrrev_i32_e32 v2, 31, v1
	s_add_i32 s3, s3, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_cmp_lg_u32 s3, 0
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	v_add_nc_u32_e32 v1, s2, v1
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v4, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v3, vcc_lo
	v_add_co_u32 v6, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v7, vcc_lo, s7, v3, vcc_lo
	global_load_b32 v0, v[4:5], off
	global_load_b32 v4, v[6:7], off
	v_add_co_u32 v2, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v0, v0, v4
	global_store_b32 v[2:3], v0, off
	s_cbranch_scc1 .LBB1_2
.LBB1_3:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z16addMatOnDevice1DPfS_S_ii
		.amdhsa_group_segment_fixed_size 0
		.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 8
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z16addMatOnDevice1DPfS_S_ii, .Lfunc_end1-_Z16addMatOnDevice1DPfS_S_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 208
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 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	_Z17addMatOnDeviceMixPfS_S_ii ; -- Begin function _Z17addMatOnDeviceMixPfS_S_ii
	.globl	_Z17addMatOnDeviceMixPfS_S_ii
	.p2align	8
	.type	_Z17addMatOnDeviceMixPfS_S_ii,@function
_Z17addMatOnDeviceMixPfS_S_ii:          ; @_Z17addMatOnDeviceMixPfS_S_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x2c
	s_load_b32 s2, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s3, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s14, s3, v[0:1]
	s_mov_b32 s3, exec_lo
	v_cmpx_gt_i32_e64 s2, v1
	s_cbranch_execz .LBB2_2
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s15, s2, v[1:2]
	s_load_b64 s[0:1], s[0:1], 0x10
	v_ashrrev_i32_e32 v3, 31, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v1, vcc_lo
	v_add_co_u32 v4, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v1, vcc_lo
	v_add_co_u32 v0, vcc_lo, s0, v0
	global_load_b32 v2, v[2:3], off
	global_load_b32 v3, v[4:5], off
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v2, v2, v3
	global_store_b32 v[0:1], v2, off
.LBB2_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17addMatOnDeviceMixPfS_S_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.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_end2:
	.size	_Z17addMatOnDeviceMixPfS_S_ii, .Lfunc_end2-_Z17addMatOnDeviceMixPfS_S_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 192
; 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: 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
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z16addMatOnDevice2DPfS_S_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z16addMatOnDevice2DPfS_S_ii.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
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z16addMatOnDevice1DPfS_S_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z16addMatOnDevice1DPfS_S_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z17addMatOnDeviceMixPfS_S_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z17addMatOnDeviceMixPfS_S_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
