#include "cuda_runtime.h"
#include "device_launch_parameters.h"

// #include <vld.h>
#include <algorithm>
#include <chrono>
#include <iostream>
#include <exception>
#include <random>

typedef double type_t;

const size_t size = 2000;
const size_t blockSize = 32;

type_t* matrixCreate();
void matrixRelease(type_t *matrix);
type_t maxDiff(type_t* a, type_t* b);
float multiplyWithCPU(type_t* a, type_t* b, type_t* c);
float multiplyWithCuda(type_t* a, type_t* b, type_t* c);

namespace MyCudaErrorHandler
{
    enum errorCodes
    {
        CUDA_START,
        CUDA_MALLOC,
        CUDA_MEMCPY,
        CUDA_LAUNCH_KERNEL,
        CUDA_DEVICE_SYNCHRONIZE,
    };

    class MyCudaException : public std::exception
    {
        cudaError_t status;
        errorCodes err;
    public:
        MyCudaException(errorCodes errorType, cudaError_t& cudaStatus) : err(errorType), status(cudaStatus) {};

        void printInfo()
        {
            switch (err)
            {
            case CUDA_START:
                std::cout << "\ncudaSetDevice failed!\n Do you have a CUDA-capable GPU installed?\n";
                break;
            case CUDA_MALLOC:
                std::cout << "cudaMalloc failed!";
                break;
            case CUDA_MEMCPY:
                std::cout << "cudaMemcpy failed!";
                break;
            case CUDA_LAUNCH_KERNEL:
                std::cout << "addKernel launch failed: " << cudaGetErrorString(status) << std::endl;
                break;
            case CUDA_DEVICE_SYNCHRONIZE:
                std::cout << "cudaDeviceSynchronize returned error code " << status << " after launching addKernel!\n";
                break;
            default:
                std::cout << "Unsupported error type!!!\n" << cudaGetErrorString(status);
            }
        }
    };

    void checkCudaStatus(errorCodes errorType, cudaError_t& cudaStatus)
    {
        if (cudaStatus != cudaSuccess)
            throw MyCudaException(errorType, cudaStatus);
    }
}



__global__ void multiplyKernel(type_t* a, type_t* b, type_t* c)
{
    size_t i = blockDim.y * blockIdx.y + threadIdx.y;
    size_t j = blockDim.x * blockIdx.x + threadIdx.x;

    if (i >= size || j >= size)
        return;

    size_t index = i * size + j;
    c[index] = 0;

    for (size_t k = 0; k < size; ++k)
    {
        c[index] += a[i * size + k] * b[k * size + j];
    }
}

int main()
{
    type_t* a = matrixCreate();
    type_t* b = matrixCreate();
    type_t* cp = matrixCreate();
    type_t* gp = matrixCreate();
 
    std::cout << "Started, matrix size - " << size << ", gpu block size: " << blockSize << std::endl;
    float gpuTime = multiplyWithCuda(a, b, gp);
    std::cout << "GPU elapsed time (in seconds): " << gpuTime << std::endl;
    float cpuTime = multiplyWithCPU(a, b, cp);
    std::cout << "CPU elapsed time (in seconds): " << cpuTime << std::endl;
    std::cout << "Max diff: " << maxDiff(cp, gp) << std::endl;

    matrixRelease(a);
    matrixRelease(b);
    matrixRelease(cp);
    matrixRelease(gp);
    return 0;
}

type_t maxDiff(type_t* a, type_t* b)
{
    int n = size * size;
    type_t m = 0;

    for (int i = 0; i < n; ++i)
    {
        m = std::max(m, std::abs(a[i] - b[i]));
    }

    return m;
}

type_t* matrixCreate()
{
    const type_t min = -100;
    const type_t max = 100;

    std::random_device rd;  
    std::mt19937 gen(rd());
    std::uniform_real_distribution<> distrib(min, max);

    int n = size * size;
    type_t *matrix = new type_t[n];

    for (int i = 0; i < n; ++i)
    {
        matrix[i] = distrib(gen);
    }

    return matrix;
}

void matrixRelease(type_t* matrix)
{
    delete[] matrix;
}

float multiplyWithCPU(type_t* a, type_t* b, type_t* c)
{
    auto begin = std::chrono::high_resolution_clock::now();

    for (int row = 0; row < size; ++row)
    {
        for (int col = 0; col < size; ++col)
        {
            c[row * size + col] = 0;
            for (int k = 0; k < size; ++k)
            {
                c[row * size + col] += a[size * row + k] * b[size * k + col];
            }
        }
    }

    auto end = std::chrono::high_resolution_clock::now();
    auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end - begin);

    return elapsed.count() / 1000.0f;
}

float multiplyWithCuda(type_t *a, type_t *b, type_t *c) 
{
    type_t* dev_a = 0;
    type_t* dev_b = 0;
    type_t* dev_c = 0;

    int byteSize = size * size * sizeof(type_t);

    unsigned int gridDim = (unsigned int)ceil((double)size / blockSize);
    dim3 block(blockSize, blockSize);
    dim3 grid(gridDim, gridDim);

    cudaError_t cudaStatus;
    cudaEvent_t start, stop;
    
    float gpuTime = 0.0f;

    cudaEventCreate(&start);
    cudaEventCreate(&stop);
    cudaEventRecord(start, 0);

    try 
    {
        cudaStatus = cudaSetDevice(0);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_START, cudaStatus);

        // Allocate GPU buffers for three vectors (two input, one output)    .
        cudaStatus = cudaMalloc((void**)&dev_c, byteSize);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MALLOC, cudaStatus);
      
        cudaStatus = cudaMalloc((void**)&dev_a, byteSize);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MALLOC, cudaStatus);

        cudaStatus = cudaMalloc((void**)&dev_b, byteSize);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MALLOC, cudaStatus);

        // Copy input vectors from host memory to GPU buffers.
        cudaStatus = cudaMemcpy(dev_a, a, byteSize, cudaMemcpyHostToDevice);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MEMCPY, cudaStatus);

        cudaStatus = cudaMemcpy(dev_b, b, byteSize, cudaMemcpyHostToDevice);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MEMCPY, cudaStatus);

        // Launch a kernel on the GPU with one thread for each element.
        multiplyKernel <<<grid, block >>> (dev_a, dev_b, dev_c);

        // Check for any errors launching the kernel
        cudaStatus = cudaGetLastError();
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_LAUNCH_KERNEL, cudaStatus);

        // cudaDeviceSynchronize waits for the kernel to finish, and returns
        // any errors encountered during the launch.
        cudaStatus = cudaDeviceSynchronize();
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_DEVICE_SYNCHRONIZE, cudaStatus);

        // Copy output vector from GPU buffer to host memory.
        cudaStatus = cudaMemcpy(c, dev_c, byteSize, cudaMemcpyDeviceToHost);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MEMCPY, cudaStatus);
    }
    catch (MyCudaErrorHandler::MyCudaException &e)
    {
        e.printInfo();

        cudaFree(dev_a);
        cudaFree(dev_b);
        cudaFree(dev_c);
        cudaEventRecord(stop, 0);

        return -1;
    }
    
    cudaFree(dev_a);
    cudaFree(dev_b);
    cudaFree(dev_c);

    cudaEventRecord(stop, 0);
    cudaEventSynchronize(stop);
    cudaEventElapsedTime(&gpuTime, start, stop);

    return gpuTime / 1000.0f;
}

	.file	"tmpxft_0039eac9_00000000-6_kernel.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.section	.text._ZN18MyCudaErrorHandler15MyCudaExceptionD2Ev,"axG",@progbits,_ZN18MyCudaErrorHandler15MyCudaExceptionD5Ev,comdat
	.align 2
	.weak	_ZN18MyCudaErrorHandler15MyCudaExceptionD2Ev
	.type	_ZN18MyCudaErrorHandler15MyCudaExceptionD2Ev, @function
_ZN18MyCudaErrorHandler15MyCudaExceptionD2Ev:
.LFB5041:
	.cfi_startproc
	endbr64
	leaq	16+_ZTVN18MyCudaErrorHandler15MyCudaExceptionE(%rip), %rax
	movq	%rax, (%rdi)
	jmp	_ZNSt9exceptionD2Ev@PLT
	.cfi_endproc
.LFE5041:
	.size	_ZN18MyCudaErrorHandler15MyCudaExceptionD2Ev, .-_ZN18MyCudaErrorHandler15MyCudaExceptionD2Ev
	.weak	_ZN18MyCudaErrorHandler15MyCudaExceptionD1Ev
	.set	_ZN18MyCudaErrorHandler15MyCudaExceptionD1Ev,_ZN18MyCudaErrorHandler15MyCudaExceptionD2Ev
	.section	.text._ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev,"axG",@progbits,_ZN18MyCudaErrorHandler15MyCudaExceptionD5Ev,comdat
	.align 2
	.weak	_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev
	.type	_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev, @function
_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev:
.LFB5043:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movq	%rdi, 8(%rsp)
	call	_ZN18MyCudaErrorHandler15MyCudaExceptionD1Ev
	movq	8(%rsp), %rdi
	movl	$16, %esi
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	jmp	_ZdlPvm@PLT
	.cfi_endproc
.LFE5043:
	.size	_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev, .-_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev
	.text
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB5055:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE5055:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB5832:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE5832:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.section	.rodata._ZN18MyCudaErrorHandler15MyCudaException9printInfoEv.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\ncudaSetDevice failed!\n Do you have a CUDA-capable GPU installed?\n"
.LC1:
	.string	"cudaMalloc failed!"
.LC2:
	.string	"cudaMemcpy failed!"
.LC3:
	.string	"addKernel launch failed: "
.LC4:
	.string	"cudaDeviceSynchronize returned error code "
.LC5:
	.string	" after launching addKernel!\n"
.LC6:
	.string	"Unsupported error type!!!\n"
	.section	.text._ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,"axG",@progbits,_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,comdat
	.align 2
	.weak	_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv
	.type	_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv, @function
_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv:
.LFB5038:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	pushq	%rcx
	.cfi_def_cfa_offset 32
	cmpl	$4, 12(%rdi)
	leaq	_ZSt4cout(%rip), %rdi
	ja	.L7
	movl	12(%rbx), %eax
	leaq	.L9(%rip), %rdx
	movslq	(%rdx,%rax,4), %rax
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata._ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,"aG",@progbits,_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,comdat
	.align 4
	.align 4
.L9:
	.long	.L13-.L9
	.long	.L12-.L9
	.long	.L11-.L9
	.long	.L10-.L9
	.long	.L8-.L9
	.section	.text._ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,"axG",@progbits,_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,comdat
.L13:
	leaq	.LC0(%rip), %rsi
	jmp	.L15
.L12:
	leaq	.LC1(%rip), %rsi
	jmp	.L15
.L11:
	leaq	.LC2(%rip), %rsi
	jmp	.L15
.L10:
	leaq	.LC3(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	8(%rbx), %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rbp, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	popq	%rdx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movq	%rax, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	_ZNSolsEPFRSoS_E.isra.0
.L8:
	.cfi_restore_state
	leaq	.LC4(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	8(%rbx), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	jmp	.L15
.L7:
	leaq	.LC6(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	8(%rbx), %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rbp, %rdi
	movq	%rax, %rsi
.L15:
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	.cfi_endproc
.LFE5038:
	.size	_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv, .-_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv
	.text
	.globl	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
	.type	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError, @function
_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError:
.LFB5039:
	.cfi_startproc
	endbr64
	cmpl	$0, (%rsi)
	je	.L17
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %ebp
	movl	$16, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rsi, %rbx
	pushq	%rax
	.cfi_def_cfa_offset 32
	call	__cxa_allocate_exception@PLT
	leaq	_ZN18MyCudaErrorHandler15MyCudaExceptionD1Ev(%rip), %rdx
	leaq	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE(%rip), %rsi
	movq	%rax, %rdi
	leaq	16+_ZTVN18MyCudaErrorHandler15MyCudaExceptionE(%rip), %rax
	movq	%rax, (%rdi)
	movl	(%rbx), %eax
	movl	%ebp, 12(%rdi)
	movl	%eax, 8(%rdi)
	call	__cxa_throw@PLT
.L17:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE5039:
	.size	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError, .-_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
	.globl	_Z7maxDiffPdS_
	.type	_Z7maxDiffPdS_, @function
_Z7maxDiffPdS_:
.LFB5045:
	.cfi_startproc
	endbr64
	movq	.LC8(%rip), %xmm2
	xorl	%eax, %eax
	xorps	%xmm1, %xmm1
.L25:
	movsd	(%rdi,%rax), %xmm0
	subsd	(%rsi,%rax), %xmm0
	addq	$8, %rax
	andps	%xmm2, %xmm0
	maxsd	%xmm1, %xmm0
	movaps	%xmm0, %xmm1
	cmpq	$32000000, %rax
	jne	.L25
	ret
	.cfi_endproc
.LFE5045:
	.size	_Z7maxDiffPdS_, .-_Z7maxDiffPdS_
	.globl	_Z13matrixReleasePd
	.type	_Z13matrixReleasePd, @function
_Z13matrixReleasePd:
.LFB5047:
	.cfi_startproc
	endbr64
	testq	%rdi, %rdi
	je	.L28
	jmp	_ZdaPv@PLT
.L28:
	ret
	.cfi_endproc
.LFE5047:
	.size	_Z13matrixReleasePd, .-_Z13matrixReleasePd
	.globl	_Z15multiplyWithCPUPdS_S_
	.type	_Z15multiplyWithCPUPdS_S_, @function
_Z15multiplyWithCPUPdS_S_:
.LFB5048:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	pushq	%rcx
	.cfi_def_cfa_offset 48
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movq	%rax, %rbx
.L31:
	leaq	(%r12,%rcx), %rax
	xorl	%esi, %esi
	leaq	0(%rbp,%rcx), %r9
.L33:
	movq	$0x000000000, (%rax)
	leaq	0(%r13,%rsi,8), %r8
	xorl	%edi, %edi
.L32:
	movsd	(%r9,%rdi,8), %xmm0
	mulsd	(%r8), %xmm0
	incq	%rdi
	addq	$16000, %r8
	addsd	(%rax), %xmm0
	movsd	%xmm0, (%rax)
	cmpq	$2000, %rdi
	jne	.L32
	incq	%rsi
	addq	$8, %rax
	cmpq	$2000, %rsi
	jne	.L33
	addq	$2000, %rdx
	addq	$16000, %rcx
	cmpq	$4000000, %rdx
	jne	.L31
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	$1000000, %ecx
	subq	%rbx, %rax
	cqto
	idivq	%rcx
	cvtsi2ssq	%rax, %xmm0
	divss	.LC9(%rip), %xmm0
	popq	%rax
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5048:
	.size	_Z15multiplyWithCPUPdS_S_, .-_Z15multiplyWithCPUPdS_S_
	.globl	_Z38__device_stub__Z14multiplyKernelPdS_S_PdS_S_
	.type	_Z38__device_stub__Z14multiplyKernelPdS_S_PdS_S_, @function
_Z38__device_stub__Z14multiplyKernelPdS_S_PdS_S_:
.LFB5077:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L38
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z14multiplyKernelPdS_S_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L38:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5077:
	.size	_Z38__device_stub__Z14multiplyKernelPdS_S_PdS_S_, .-_Z38__device_stub__Z14multiplyKernelPdS_S_PdS_S_
	.globl	_Z14multiplyKernelPdS_S_
	.type	_Z14multiplyKernelPdS_S_, @function
_Z14multiplyKernelPdS_S_:
.LFB5078:
	.cfi_startproc
	endbr64
	jmp	_Z38__device_stub__Z14multiplyKernelPdS_S_PdS_S_
	.cfi_endproc
.LFE5078:
	.size	_Z14multiplyKernelPdS_S_, .-_Z14multiplyKernelPdS_S_
	.globl	_Z16multiplyWithCudaPdS_S_
	.type	_Z16multiplyWithCudaPdS_S_, @function
_Z16multiplyWithCudaPdS_S_:
.LFB5052:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA5052
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$88, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	xorl	%eax, %eax
	leaq	32(%rsp), %rdi
	movl	$1, 56(%rsp)
	movq	%rax, 8(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, 24(%rsp)
	movabsq	$137438953504, %rax
	movq	%rax, 48(%rsp)
	movabsq	$270582939711, %rax
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	movl	$0x00000000, 4(%rsp)
.LEHB0:
	call	cudaEventCreate@PLT
	leaq	40(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
.LEHE0:
	xorl	%edi, %edi
.LEHB1:
	call	cudaSetDevice@PLT
	movq	%rsp, %rbx
	xorl	%edi, %edi
	movl	%eax, (%rsp)
	movq	%rbx, %rsi
	call	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
	leaq	24(%rsp), %rdi
	movl	$32000000, %esi
	call	cudaMalloc@PLT
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	%eax, (%rsp)
	call	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
	leaq	8(%rsp), %rdi
	movl	$32000000, %esi
	call	cudaMalloc@PLT
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	%eax, (%rsp)
	call	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
	leaq	16(%rsp), %rdi
	movl	$32000000, %esi
	call	cudaMalloc@PLT
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	%eax, (%rsp)
	call	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	movl	$32000000, %edx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	movl	%eax, (%rsp)
	call	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	movl	$32000000, %edx
	movq	%r12, %rsi
	call	cudaMemcpy@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	movl	%eax, (%rsp)
	call	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
	movl	56(%rsp), %ecx
	movq	48(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	60(%rsp), %rdi
	movl	68(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L44
.L46:
	call	cudaGetLastError@PLT
	movq	%rbx, %rsi
	movl	$3, %edi
	movl	%eax, (%rsp)
	call	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
	jmp	.L61
.L44:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	call	_Z38__device_stub__Z14multiplyKernelPdS_S_PdS_S_
	jmp	.L46
.L61:
	call	cudaDeviceSynchronize@PLT
	movq	%rbx, %rsi
	movl	$4, %edi
	movl	%eax, (%rsp)
	call	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movl	$32000000, %edx
	movq	%rbp, %rdi
	call	cudaMemcpy@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	movl	%eax, (%rsp)
	call	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER9cudaError
.LEHE1:
	movq	8(%rsp), %rdi
.LEHB2:
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	40(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	leaq	4(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
.LEHE2:
	movss	4(%rsp), %xmm0
	divss	.LC9(%rip), %xmm0
	jmp	.L43
.L54:
	endbr64
	movq	%rax, %rdi
.L47:
	decq	%rdx
	je	.L48
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L59
	jmp	.L60
.L48:
	call	__cxa_begin_catch@PLT
	movq	%rax, %rdi
.LEHB3:
	call	_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
.LEHE3:
	call	__cxa_end_catch@PLT
	movss	.LC10(%rip), %xmm0
	jmp	.L43
.L55:
	endbr64
	movq	%rax, %rbx
.L51:
	call	__cxa_end_catch@PLT
	movq	%rbx, %rdi
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L60
.L59:
.LEHB4:
	call	_Unwind_Resume@PLT
.LEHE4:
.L43:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L53
.L60:
	call	__stack_chk_fail@PLT
.L53:
	addq	$88, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5052:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
	.align 4
.LLSDA5052:
	.byte	0xff
	.byte	0x9b
	.uleb128 .LLSDATT5052-.LLSDATTD5052
.LLSDATTD5052:
	.byte	0x1
	.uleb128 .LLSDACSE5052-.LLSDACSB5052
.LLSDACSB5052:
	.uleb128 .LEHB0-.LFB5052
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB5052
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L54-.LFB5052
	.uleb128 0x1
	.uleb128 .LEHB2-.LFB5052
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB3-.LFB5052
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L55-.LFB5052
	.uleb128 0
	.uleb128 .LEHB4-.LFB5052
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
.LLSDACSE5052:
	.byte	0x1
	.byte	0
	.align 4
	.long	DW.ref._ZTIN18MyCudaErrorHandler15MyCudaExceptionE-.
.LLSDATT5052:
	.text
	.size	_Z16multiplyWithCudaPdS_S_, .-_Z16multiplyWithCudaPdS_S_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC12:
	.string	"_Z14multiplyKernelPdS_S_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB5080:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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	.LC12(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z14multiplyKernelPdS_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	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	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE5080:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,"axG",@progbits,_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,comdat
	.align 2
	.weak	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.type	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv, @function
_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv:
.LFB5821:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	xorl	%edx, %edx
	movl	$2567483615, %edi
.L66:
	movq	(%rax,%rdx,8), %rsi
	incq	%rdx
	movq	(%rax,%rdx,8), %rcx
	andq	$-2147483648, %rsi
	andl	$2147483647, %ecx
	orq	%rsi, %rcx
	movq	%rcx, %rsi
	shrq	%rsi
	xorq	3168(%rax,%rdx,8), %rsi
	andl	$1, %ecx
	je	.L65
	movq	%rdi, %rcx
.L65:
	xorq	%rsi, %rcx
	movq	%rcx, -8(%rax,%rdx,8)
	cmpq	$227, %rdx
	jne	.L66
	movl	$2567483615, %edi
.L68:
	movq	(%rax,%rdx,8), %rsi
	incq	%rdx
	movq	(%rax,%rdx,8), %rcx
	andq	$-2147483648, %rsi
	andl	$2147483647, %ecx
	orq	%rsi, %rcx
	movq	%rcx, %rsi
	shrq	%rsi
	xorq	-1824(%rax,%rdx,8), %rsi
	andl	$1, %ecx
	je	.L67
	movq	%rdi, %rcx
.L67:
	xorq	%rsi, %rcx
	movq	%rcx, -8(%rax,%rdx,8)
	cmpq	$623, %rdx
	jne	.L68
	movq	4984(%rax), %rdx
	movq	(%rax), %rcx
	andq	$-2147483648, %rdx
	andl	$2147483647, %ecx
	orq	%rcx, %rdx
	movq	%rdx, %rcx
	shrq	%rcx
	xorq	3168(%rax), %rcx
	andl	$1, %edx
	je	.L69
	movl	$2567483615, %edx
.L69:
	xorq	%rcx, %rdx
	movq	%rdx, 4984(%rax)
	xorl	%edx, %edx
	movq	%rdx, 4992(%rax)
	ret
	.cfi_endproc
.LFE5821:
	.size	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv, .-_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.section	.rodata.str1.1
.LC15:
	.string	"default"
	.text
	.globl	_Z12matrixCreatev
	.type	_Z12matrixCreatev, @function
_Z12matrixCreatev:
.LFB5046:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA5046
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	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	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8240
	orq	$0, (%rsp)
	subq	$1840, %rsp
	.cfi_def_cfa_offset 10080
	leaq	7+.LC15(%rip), %rdx
	leaq	-7(%rdx), %rsi
	movq	%fs:40, %rax
	movq	%rax, 10024(%rsp)
	xorl	%eax, %eax
	leaq	5040(%rsp), %rdi
	leaq	24(%rsp), %r12
	movq	%rdi, 5024(%rsp)
	leaq	5024(%rsp), %rbx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	5024(%rsp), %rax
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movq	$7, 5032(%rsp)
	movb	$0, 7(%rax)
.LEHB5:
	call	_ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE5:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r12, %rdi
.LEHB6:
	call	_ZNSt13random_device9_M_getvalEv@PLT
	movl	%eax, %eax
	movl	$1, %edx
	movq	%rax, 5024(%rsp)
	jmp	.L85
.L98:
	endbr64
	movq	%rax, %rbp
.L83:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	je	.L104
	jmp	.L101
.L85:
	movq	-8(%rbx,%rdx,8), %rax
	movq	%rax, %rcx
	shrq	$30, %rcx
	xorq	%rcx, %rax
	imulq	$1812433253, %rax, %rax
	addl	%edx, %eax
	movq	%rax, (%rbx,%rdx,8)
	incq	%rdx
	cmpq	$624, %rdx
	jne	.L85
	movl	$32000000, %edi
	movq	$624, 10016(%rsp)
	call	_Znam@PLT
.LEHE6:
	movq	%rax, %rbp
	xorl	%r13d, %r13d
.L91:
	movq	.LC13(%rip), %rax
	movl	$2, %r14d
	xorps	%xmm0, %xmm0
	movq	%rax, (%rsp)
.L89:
	cmpq	$623, 10016(%rsp)
	jbe	.L86
	movq	%rbx, %rdi
	movsd	%xmm0, 8(%rsp)
	call	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	movsd	8(%rsp), %xmm0
.L86:
	movq	10016(%rsp), %rax
	leaq	1(%rax), %rdx
	movq	5024(%rsp,%rax,8), %rax
	movq	%rdx, 10016(%rsp)
	movq	%rax, %rdx
	shrq	$11, %rdx
	movl	%edx, %edx
	xorq	%rdx, %rax
	movq	%rax, %rdx
	salq	$7, %rdx
	andl	$2636928640, %edx
	xorq	%rdx, %rax
	movq	%rax, %rdx
	salq	$15, %rdx
	andl	$4022730752, %edx
	xorq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$18, %rdx
	xorq	%rdx, %rax
	js	.L87
	cvtsi2sdq	%rax, %xmm1
	jmp	.L88
.L87:
	movq	%rax, %rdx
	andl	$1, %eax
	shrq	%rdx
	orq	%rax, %rdx
	cvtsi2sdq	%rdx, %xmm1
	addsd	%xmm1, %xmm1
.L88:
	mulsd	(%rsp), %xmm1
	flds	.LC16(%rip)
	decl	%r14d
	fmull	(%rsp)
	addsd	%xmm1, %xmm0
	fstpl	(%rsp)
	je	.L105
	movl	$1, %r14d
	jmp	.L89
.L105:
	divsd	(%rsp), %xmm0
	comisd	.LC13(%rip), %xmm0
	jb	.L90
	movsd	.LC14(%rip), %xmm0
.L90:
	mulsd	.LC17(%rip), %xmm0
	subsd	.LC18(%rip), %xmm0
	movsd	%xmm0, 0(%rbp,%r13,8)
	incq	%r13
	cmpq	$4000000, %r13
	jne	.L91
	movq	%r12, %rdi
	call	_ZNSt13random_device7_M_finiEv@PLT
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	je	.L94
	jmp	.L101
.L97:
	endbr64
	movq	%rax, %rbx
.L92:
	movq	%r12, %rdi
	call	_ZNSt13random_device7_M_finiEv@PLT
	movq	%rbx, %rdi
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L101
.L104:
.LEHB7:
	call	_Unwind_Resume@PLT
.LEHE7:
.L101:
	call	__stack_chk_fail@PLT
.L94:
	addq	$10032, %rsp
	.cfi_def_cfa_offset 48
	movq	%rbp, %rax
	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
.LFE5046:
	.section	.gcc_except_table
.LLSDA5046:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE5046-.LLSDACSB5046
.LLSDACSB5046:
	.uleb128 .LEHB5-.LFB5046
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L98-.LFB5046
	.uleb128 0
	.uleb128 .LEHB6-.LFB5046
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L97-.LFB5046
	.uleb128 0
	.uleb128 .LEHB7-.LFB5046
	.uleb128 .LEHE7-.LEHB7
	.uleb128 0
	.uleb128 0
.LLSDACSE5046:
	.text
	.size	_Z12matrixCreatev, .-_Z12matrixCreatev
	.section	.rodata.str1.1
.LC20:
	.string	"Started, matrix size - "
.LC21:
	.string	", gpu block size: "
.LC22:
	.string	"GPU elapsed time (in seconds): "
.LC23:
	.string	"CPU elapsed time (in seconds): "
.LC24:
	.string	"Max diff: "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB5044:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	_ZSt4cout(%rip), %r14
	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	$16, %rsp
	.cfi_def_cfa_offset 64
	call	_Z12matrixCreatev
	movq	%rax, %r13
	call	_Z12matrixCreatev
	movq	%rax, %r12
	call	_Z12matrixCreatev
	movq	%rax, %rbp
	call	_Z12matrixCreatev
	movq	%r14, %rdi
	leaq	.LC20(%rip), %rsi
	movq	%rax, %rbx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$2000, %esi
	movq	%rax, %rdi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	leaq	.LC21(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$32, %esi
	movq	%rax, %rdi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	call	_Z16multiplyWithCudaPdS_S_
	leaq	.LC22(%rip), %rsi
	movq	%r14, %rdi
	movss	%xmm0, 12(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	12(%rsp), %xmm0
	movq	%rax, %rdi
	cvtss2sd	%xmm0, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	call	_Z15multiplyWithCPUPdS_S_
	leaq	.LC23(%rip), %rsi
	movq	%r14, %rdi
	movss	%xmm0, 12(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	12(%rsp), %xmm0
	movq	%rax, %rdi
	cvtss2sd	%xmm0, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%r14, %rdi
	leaq	.LC24(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movq	%rax, %rdx
	call	_Z7maxDiffPdS_
	movq	%rdx, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%r13, %rdi
	call	_Z13matrixReleasePd
	movq	%r12, %rdi
	call	_Z13matrixReleasePd
	movq	%rbp, %rdi
	call	_Z13matrixReleasePd
	movq	%rbx, %rdi
	call	_Z13matrixReleasePd
	addq	$16, %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
.LFE5044:
	.size	main, .-main
	.weak	_ZTSN18MyCudaErrorHandler15MyCudaExceptionE
	.section	.rodata._ZTSN18MyCudaErrorHandler15MyCudaExceptionE,"aG",@progbits,_ZTSN18MyCudaErrorHandler15MyCudaExceptionE,comdat
	.align 32
	.type	_ZTSN18MyCudaErrorHandler15MyCudaExceptionE, @object
	.size	_ZTSN18MyCudaErrorHandler15MyCudaExceptionE, 40
_ZTSN18MyCudaErrorHandler15MyCudaExceptionE:
	.string	"N18MyCudaErrorHandler15MyCudaExceptionE"
	.weak	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE
	.section	.data.rel.ro._ZTIN18MyCudaErrorHandler15MyCudaExceptionE,"awG",@progbits,_ZTIN18MyCudaErrorHandler15MyCudaExceptionE,comdat
	.align 8
	.type	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE, @object
	.size	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE, 24
_ZTIN18MyCudaErrorHandler15MyCudaExceptionE:
	.quad	_ZTVN10__cxxabiv120__si_class_type_infoE+16
	.quad	_ZTSN18MyCudaErrorHandler15MyCudaExceptionE
	.quad	_ZTISt9exception
	.weak	_ZTVN18MyCudaErrorHandler15MyCudaExceptionE
	.section	.data.rel.ro._ZTVN18MyCudaErrorHandler15MyCudaExceptionE,"awG",@progbits,_ZTVN18MyCudaErrorHandler15MyCudaExceptionE,comdat
	.align 8
	.type	_ZTVN18MyCudaErrorHandler15MyCudaExceptionE, @object
	.size	_ZTVN18MyCudaErrorHandler15MyCudaExceptionE, 40
_ZTVN18MyCudaErrorHandler15MyCudaExceptionE:
	.quad	0
	.quad	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE
	.quad	_ZN18MyCudaErrorHandler15MyCudaExceptionD1Ev
	.quad	_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev
	.quad	_ZNKSt9exception4whatEv
	.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.cst16,"aM",@progbits,16
	.align 16
.LC8:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC9:
	.long	1148846080
	.align 4
.LC10:
	.long	-1082130432
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC13:
	.long	0
	.long	1072693248
	.align 8
.LC14:
	.long	-1
	.long	1072693247
	.section	.rodata.cst4
	.align 4
.LC16:
	.long	1333788672
	.section	.rodata.cst8
	.align 8
.LC17:
	.long	0
	.long	1080623104
	.align 8
.LC18:
	.long	0
	.long	1079574528
	.hidden	DW.ref._ZTIN18MyCudaErrorHandler15MyCudaExceptionE
	.weak	DW.ref._ZTIN18MyCudaErrorHandler15MyCudaExceptionE
	.section	.data.rel.local.DW.ref._ZTIN18MyCudaErrorHandler15MyCudaExceptionE,"awG",@progbits,DW.ref._ZTIN18MyCudaErrorHandler15MyCudaExceptionE,comdat
	.align 8
	.type	DW.ref._ZTIN18MyCudaErrorHandler15MyCudaExceptionE, @object
	.size	DW.ref._ZTIN18MyCudaErrorHandler15MyCudaExceptionE, 8
DW.ref._ZTIN18MyCudaErrorHandler15MyCudaExceptionE:
	.quad	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE
	.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 <vld.h>
#include <algorithm>
#include <chrono>
#include <iostream>
#include <exception>
#include <random>

typedef double type_t;

const size_t size = 2000;
const size_t blockSize = 32;

type_t* matrixCreate();
void matrixRelease(type_t *matrix);
type_t maxDiff(type_t* a, type_t* b);
float multiplyWithCPU(type_t* a, type_t* b, type_t* c);
float multiplyWithCuda(type_t* a, type_t* b, type_t* c);

namespace MyCudaErrorHandler
{
    enum errorCodes
    {
        CUDA_START,
        CUDA_MALLOC,
        CUDA_MEMCPY,
        CUDA_LAUNCH_KERNEL,
        CUDA_DEVICE_SYNCHRONIZE,
    };

    class MyCudaException : public std::exception
    {
        hipError_t status;
        errorCodes err;
    public:
        MyCudaException(errorCodes errorType, hipError_t& cudaStatus) : err(errorType), status(cudaStatus) {};

        void printInfo()
        {
            switch (err)
            {
            case CUDA_START:
                std::cout << "\nhipSetDevice failed!\n Do you have a CUDA-capable GPU installed?\n";
                break;
            case CUDA_MALLOC:
                std::cout << "hipMalloc failed!";
                break;
            case CUDA_MEMCPY:
                std::cout << "hipMemcpy failed!";
                break;
            case CUDA_LAUNCH_KERNEL:
                std::cout << "addKernel launch failed: " << hipGetErrorString(status) << std::endl;
                break;
            case CUDA_DEVICE_SYNCHRONIZE:
                std::cout << "hipDeviceSynchronize returned error code " << status << " after launching addKernel!\n";
                break;
            default:
                std::cout << "Unsupported error type!!!\n" << hipGetErrorString(status);
            }
        }
    };

    void checkCudaStatus(errorCodes errorType, hipError_t& cudaStatus)
    {
        if (cudaStatus != hipSuccess)
            throw MyCudaException(errorType, cudaStatus);
    }
}



__global__ void multiplyKernel(type_t* a, type_t* b, type_t* c)
{
    size_t i = blockDim.y * blockIdx.y + threadIdx.y;
    size_t j = blockDim.x * blockIdx.x + threadIdx.x;

    if (i >= size || j >= size)
        return;

    size_t index = i * size + j;
    c[index] = 0;

    for (size_t k = 0; k < size; ++k)
    {
        c[index] += a[i * size + k] * b[k * size + j];
    }
}

int main()
{
    type_t* a = matrixCreate();
    type_t* b = matrixCreate();
    type_t* cp = matrixCreate();
    type_t* gp = matrixCreate();
 
    std::cout << "Started, matrix size - " << size << ", gpu block size: " << blockSize << std::endl;
    float gpuTime = multiplyWithCuda(a, b, gp);
    std::cout << "GPU elapsed time (in seconds): " << gpuTime << std::endl;
    float cpuTime = multiplyWithCPU(a, b, cp);
    std::cout << "CPU elapsed time (in seconds): " << cpuTime << std::endl;
    std::cout << "Max diff: " << maxDiff(cp, gp) << std::endl;

    matrixRelease(a);
    matrixRelease(b);
    matrixRelease(cp);
    matrixRelease(gp);
    return 0;
}

type_t maxDiff(type_t* a, type_t* b)
{
    int n = size * size;
    type_t m = 0;

    for (int i = 0; i < n; ++i)
    {
        m = std::max(m, std::abs(a[i] - b[i]));
    }

    return m;
}

type_t* matrixCreate()
{
    const type_t min = -100;
    const type_t max = 100;

    std::random_device rd;  
    std::mt19937 gen(rd());
    std::uniform_real_distribution<> distrib(min, max);

    int n = size * size;
    type_t *matrix = new type_t[n];

    for (int i = 0; i < n; ++i)
    {
        matrix[i] = distrib(gen);
    }

    return matrix;
}

void matrixRelease(type_t* matrix)
{
    delete[] matrix;
}

float multiplyWithCPU(type_t* a, type_t* b, type_t* c)
{
    auto begin = std::chrono::high_resolution_clock::now();

    for (int row = 0; row < size; ++row)
    {
        for (int col = 0; col < size; ++col)
        {
            c[row * size + col] = 0;
            for (int k = 0; k < size; ++k)
            {
                c[row * size + col] += a[size * row + k] * b[size * k + col];
            }
        }
    }

    auto end = std::chrono::high_resolution_clock::now();
    auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end - begin);

    return elapsed.count() / 1000.0f;
}

float multiplyWithCuda(type_t *a, type_t *b, type_t *c) 
{
    type_t* dev_a = 0;
    type_t* dev_b = 0;
    type_t* dev_c = 0;

    int byteSize = size * size * sizeof(type_t);

    unsigned int gridDim = (unsigned int)ceil((double)size / blockSize);
    dim3 block(blockSize, blockSize);
    dim3 grid(gridDim, gridDim);

    hipError_t cudaStatus;
    hipEvent_t start, stop;
    
    float gpuTime = 0.0f;

    hipEventCreate(&start);
    hipEventCreate(&stop);
    hipEventRecord(start, 0);

    try 
    {
        cudaStatus = hipSetDevice(0);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_START, cudaStatus);

        // Allocate GPU buffers for three vectors (two input, one output)    .
        cudaStatus = hipMalloc((void**)&dev_c, byteSize);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MALLOC, cudaStatus);
      
        cudaStatus = hipMalloc((void**)&dev_a, byteSize);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MALLOC, cudaStatus);

        cudaStatus = hipMalloc((void**)&dev_b, byteSize);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MALLOC, cudaStatus);

        // Copy input vectors from host memory to GPU buffers.
        cudaStatus = hipMemcpy(dev_a, a, byteSize, hipMemcpyHostToDevice);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MEMCPY, cudaStatus);

        cudaStatus = hipMemcpy(dev_b, b, byteSize, hipMemcpyHostToDevice);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MEMCPY, cudaStatus);

        // Launch a kernel on the GPU with one thread for each element.
        multiplyKernel <<<grid, block >>> (dev_a, dev_b, dev_c);

        // Check for any errors launching the kernel
        cudaStatus = hipGetLastError();
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_LAUNCH_KERNEL, cudaStatus);

        // cudaDeviceSynchronize waits for the kernel to finish, and returns
        // any errors encountered during the launch.
        cudaStatus = hipDeviceSynchronize();
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_DEVICE_SYNCHRONIZE, cudaStatus);

        // Copy output vector from GPU buffer to host memory.
        cudaStatus = hipMemcpy(c, dev_c, byteSize, hipMemcpyDeviceToHost);
        MyCudaErrorHandler::checkCudaStatus(MyCudaErrorHandler::CUDA_MEMCPY, cudaStatus);
    }
    catch (MyCudaErrorHandler::MyCudaException &e)
    {
        e.printInfo();

        hipFree(dev_a);
        hipFree(dev_b);
        hipFree(dev_c);
        hipEventRecord(stop, 0);

        return -1;
    }
    
    hipFree(dev_a);
    hipFree(dev_b);
    hipFree(dev_c);

    hipEventRecord(stop, 0);
    hipEventSynchronize(stop);
    hipEventElapsedTime(&gpuTime, start, stop);

    return gpuTime / 1000.0f;
}

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

                                        # End of file scope inline assembly
	.globl	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t # -- Begin function _ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
	.type	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t,@function
_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t: # @_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
	.cfi_startproc
# %bb.0:
	cmpl	$0, (%rsi)
	jne	.LBB0_2
# %bb.1:
	retq
.LBB0_2:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rsi, %r14
	movl	%edi, %ebx
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	$_ZTVN18MyCudaErrorHandler15MyCudaExceptionE+16, (%rax)
	movl	(%r14), %ecx
	movl	%ecx, 8(%rax)
	movl	%ebx, 12(%rax)
	movl	$_ZTIN18MyCudaErrorHandler15MyCudaExceptionE, %esi
	movl	$_ZNSt9exceptionD2Ev, %edx
	movq	%rax, %rdi
	callq	__cxa_throw
.Lfunc_end0:
	.size	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t, .Lfunc_end0-_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__multiplyKernelPdS_S_ # -- Begin function _Z29__device_stub__multiplyKernelPdS_S_
	.type	_Z29__device_stub__multiplyKernelPdS_S_,@function
_Z29__device_stub__multiplyKernelPdS_S_: # @_Z29__device_stub__multiplyKernelPdS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z14multiplyKernelPdS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z29__device_stub__multiplyKernelPdS_S_, .Lfunc_end1-_Z29__device_stub__multiplyKernelPdS_S_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI2_0:
	.quad	0x7fffffffffffffff              # double NaN
	.quad	0x7fffffffffffffff              # double NaN
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	callq	_Z12matrixCreatev
	movq	%rax, %rbx
	callq	_Z12matrixCreatev
	movq	%rax, %r14
	callq	_Z12matrixCreatev
	movq	%rax, %r15
	callq	_Z12matrixCreatev
	movq	%rax, %r12
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$2000, %esi                     # imm = 0x7D0
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %r13
	movl	$.L.str.1, %esi
	movl	$18, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$32, %esi
	movq	%r13, %rdi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_Z16multiplyWithCudaPdS_S_
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$31, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	12(%rsp), %xmm0                 # 4-byte Folded Reload
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_Z15multiplyWithCPUPdS_S_
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$31, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	12(%rsp), %xmm0                 # 4-byte Folded Reload
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	xorl	%eax, %eax
	movapd	.LCPI2_0(%rip), %xmm1           # xmm1 = [NaN,NaN]
.LBB2_1:                                # =>This Inner Loop Header: Depth=1
	movaps	%xmm0, %xmm2
	movsd	(%r15,%rax,8), %xmm0            # xmm0 = mem[0],zero
	subsd	(%r12,%rax,8), %xmm0
	andpd	%xmm1, %xmm0
	maxsd	%xmm2, %xmm0
	incq	%rax
	cmpq	$4000000, %rax                  # imm = 0x3D0900
	jne	.LBB2_1
# %bb.2:                                # %_Z7maxDiffPdS_.exit
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%rbx, %rdi
	callq	_ZdaPv
	movq	%r14, %rdi
	callq	_ZdaPv
	movq	%r15, %rdi
	callq	_ZdaPv
	movq	%r12, %rdi
	callq	_ZdaPv
	xorl	%eax, %eax
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z12matrixCreatev
.LCPI3_0:
	.quad	0x4069000000000000              # double 200
.LCPI3_1:
	.quad	0xc059000000000000              # double -100
	.text
	.globl	_Z12matrixCreatev
	.type	_Z12matrixCreatev,@function
_Z12matrixCreatev:                      # @_Z12matrixCreatev
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$10000, %rsp                    # imm = 0x2710
	.cfi_def_cfa_offset 10032
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	5000(%rsp), %rbx
	movq	%rbx, %rdi
	callq	_ZNSt13random_deviceC2Ev
.Ltmp0:
	movq	%rbx, %rdi
	callq	_ZNSt13random_device9_M_getvalEv
.Ltmp1:
# %bb.1:                                # %_ZNSt13random_deviceclEv.exit
	movl	%eax, %eax
	movq	%rax, (%rsp)
	movl	$1, %ecx
.LBB3_2:                                # =>This Inner Loop Header: Depth=1
	movq	%rax, %rdx
	shrq	$30, %rdx
	xorl	%eax, %edx
	imull	$1812433253, %edx, %eax         # imm = 0x6C078965
	addl	%ecx, %eax
	movq	%rax, (%rsp,%rcx,8)
	incq	%rcx
	cmpq	$624, %rcx                      # imm = 0x270
	jne	.LBB3_2
# %bb.3:
	movq	$624, 4992(%rsp)                # imm = 0x270
.Ltmp3:
	movl	$32000000, %edi                 # imm = 0x1E84800
	callq	_Znam
.Ltmp4:
# %bb.4:                                # %.preheader.preheader
	movq	%rax, %rbx
	xorl	%r15d, %r15d
	movq	%rsp, %r14
.LBB3_5:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
.Ltmp6:
	movq	%r14, %rdi
	callq	_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_
.Ltmp7:
# %bb.6:                                #   in Loop: Header=BB3_5 Depth=1
	mulsd	.LCPI3_0(%rip), %xmm0
	addsd	.LCPI3_1(%rip), %xmm0
	movsd	%xmm0, (%rbx,%r15,8)
	incq	%r15
	cmpq	$4000000, %r15                  # imm = 0x3D0900
	jne	.LBB3_5
# %bb.7:
.Ltmp12:
	leaq	5000(%rsp), %rdi
	callq	_ZNSt13random_device7_M_finiEv
.Ltmp13:
# %bb.8:                                # %_ZNSt13random_deviceD2Ev.exit
	movq	%rbx, %rax
	addq	$10000, %rsp                    # imm = 0x2710
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB3_9:
	.cfi_def_cfa_offset 10032
.Ltmp14:
	jmp	.LBB3_10
.LBB3_11:
.Ltmp5:
	jmp	.LBB3_14
.LBB3_12:
.Ltmp2:
	jmp	.LBB3_14
.LBB3_13:
.Ltmp8:
.LBB3_14:
	movq	%rax, %rbx
.Ltmp9:
	leaq	5000(%rsp), %rdi
	callq	_ZNSt13random_device7_M_finiEv
.Ltmp10:
# %bb.15:                               # %_ZNSt13random_deviceD2Ev.exit15
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB3_16:
.Ltmp11:
.LBB3_10:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end3:
	.size	_Z12matrixCreatev, .Lfunc_end3-_Z12matrixCreatev
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table3:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 6 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin0          #     jumps to .Ltmp11
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp10-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Lfunc_end3-.Ltmp10            #   Call between .Ltmp10 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z16multiplyWithCudaPdS_S_
.LCPI4_0:
	.long	0xbf800000                      # float -1
.LCPI4_1:
	.long	0x447a0000                      # float 1000
	.text
	.globl	_Z16multiplyWithCudaPdS_S_
	.type	_Z16multiplyWithCudaPdS_S_,@function
_Z16multiplyWithCudaPdS_S_:             # @_Z16multiplyWithCudaPdS_S_
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %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
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	xorl	%eax, %eax
	movq	%rax, 24(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, 8(%rsp)
	movl	$0, 44(%rsp)
	leaq	48(%rsp), %r12
	movq	%r12, %rdi
	callq	hipEventCreate
	leaq	32(%rsp), %rdi
	callq	hipEventCreate
	movq	(%r12), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp15:
	xorl	%edi, %edi
	callq	hipSetDevice
.Ltmp16:
# %bb.1:
	leaq	4(%rsp), %rsi
	movl	%eax, (%rsi)
.Ltmp17:
	xorl	%edi, %edi
	callq	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
.Ltmp18:
# %bb.2:
.Ltmp19:
	leaq	8(%rsp), %rdi
	movl	$32000000, %esi                 # imm = 0x1E84800
	callq	hipMalloc
.Ltmp20:
# %bb.3:
	leaq	4(%rsp), %rsi
	movl	%eax, (%rsi)
.Ltmp21:
	movl	$1, %edi
	callq	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
.Ltmp22:
# %bb.4:
.Ltmp23:
	leaq	24(%rsp), %rdi
	movl	$32000000, %esi                 # imm = 0x1E84800
	callq	hipMalloc
.Ltmp24:
# %bb.5:
	leaq	4(%rsp), %rsi
	movl	%eax, (%rsi)
.Ltmp25:
	movl	$1, %edi
	callq	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
.Ltmp26:
# %bb.6:
.Ltmp27:
	leaq	16(%rsp), %rdi
	movl	$32000000, %esi                 # imm = 0x1E84800
	callq	hipMalloc
.Ltmp28:
# %bb.7:
	leaq	4(%rsp), %rsi
	movl	%eax, (%rsi)
.Ltmp29:
	movl	$1, %edi
	callq	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
.Ltmp30:
# %bb.8:
	movq	24(%rsp), %rdi
.Ltmp31:
	movl	$32000000, %edx                 # imm = 0x1E84800
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp32:
# %bb.9:
	leaq	4(%rsp), %rsi
	movl	%eax, (%rsi)
.Ltmp33:
	movl	$2, %edi
	callq	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
.Ltmp34:
# %bb.10:
	movq	16(%rsp), %rdi
.Ltmp35:
	movl	$32000000, %edx                 # imm = 0x1E84800
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp36:
# %bb.11:
	leaq	4(%rsp), %rsi
	movl	%eax, (%rsi)
.Ltmp37:
	movl	$2, %edi
	callq	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
.Ltmp38:
# %bb.12:
.Ltmp39:
	movabsq	$270582939711, %rdi             # imm = 0x3F0000003F
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp40:
# %bb.13:
	testl	%eax, %eax
	jne	.LBB4_15
# %bb.14:
	movq	24(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdx
.Ltmp41:
	callq	_Z29__device_stub__multiplyKernelPdS_S_
.Ltmp42:
.LBB4_15:
.Ltmp43:
	callq	hipGetLastError
.Ltmp44:
# %bb.16:
	leaq	4(%rsp), %rsi
	movl	%eax, (%rsi)
.Ltmp45:
	movl	$3, %edi
	callq	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
.Ltmp46:
# %bb.17:
.Ltmp47:
	callq	hipDeviceSynchronize
.Ltmp48:
# %bb.18:
	leaq	4(%rsp), %rsi
	movl	%eax, (%rsi)
.Ltmp49:
	movl	$4, %edi
	callq	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
.Ltmp50:
# %bb.19:
	movq	8(%rsp), %rsi
.Ltmp51:
	movl	$32000000, %edx                 # imm = 0x1E84800
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp52:
# %bb.20:
	leaq	4(%rsp), %rsi
	movl	%eax, (%rsi)
.Ltmp53:
	movl	$2, %edi
	callq	_ZN18MyCudaErrorHandler15checkCudaStatusENS_10errorCodesER10hipError_t
.Ltmp54:
# %bb.21:
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	32(%rsp), %rdi
	callq	hipEventSynchronize
	movq	48(%rsp), %rsi
	movq	32(%rsp), %rdx
	leaq	44(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	movss	(%rbx), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI4_1(%rip), %xmm0
.LBB4_29:
	addq	$56, %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
.LBB4_22:
	.cfi_def_cfa_offset 96
.Ltmp55:
	movq	%rax, %rbx
	cmpl	$1, %edx
	jne	.LBB4_31
# %bb.23:
	movq	%rbx, %rdi
	callq	__cxa_begin_catch
.Ltmp56:
	movq	%rax, %rdi
	callq	_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv
.Ltmp57:
# %bb.24:
	movq	24(%rsp), %rdi
.Ltmp58:
	callq	hipFree
.Ltmp59:
# %bb.25:
	movq	16(%rsp), %rdi
.Ltmp60:
	callq	hipFree
.Ltmp61:
# %bb.26:
	movq	8(%rsp), %rdi
.Ltmp62:
	callq	hipFree
.Ltmp63:
# %bb.27:
	movq	32(%rsp), %rdi
.Ltmp64:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp65:
# %bb.28:
	callq	__cxa_end_catch
	movss	.LCPI4_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	jmp	.LBB4_29
.LBB4_30:
.Ltmp66:
	movq	%rax, %rbx
.Ltmp67:
	callq	__cxa_end_catch
.Ltmp68:
.LBB4_31:
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB4_32:
.Ltmp69:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end4:
	.size	_Z16multiplyWithCudaPdS_S_, .Lfunc_end4-_Z16multiplyWithCudaPdS_S_
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table4:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase1-.Lttbaseref1
.Lttbaseref1:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp15-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp15
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp54-.Ltmp15                #   Call between .Ltmp15 and .Ltmp54
	.uleb128 .Ltmp55-.Lfunc_begin1          #     jumps to .Ltmp55
	.byte	3                               #   On action: 2
	.uleb128 .Ltmp54-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp56-.Ltmp54                #   Call between .Ltmp54 and .Ltmp56
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp56-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp65-.Ltmp56                #   Call between .Ltmp56 and .Ltmp65
	.uleb128 .Ltmp66-.Lfunc_begin1          #     jumps to .Ltmp66
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp65-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp67-.Ltmp65                #   Call between .Ltmp65 and .Ltmp67
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp67-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Ltmp68-.Ltmp67                #   Call between .Ltmp67 and .Ltmp68
	.uleb128 .Ltmp69-.Lfunc_begin1          #     jumps to .Ltmp69
	.byte	5                               #   On action: 3
	.uleb128 .Ltmp68-.Lfunc_begin1          # >> Call Site 7 <<
	.uleb128 .Lfunc_end4-.Ltmp68            #   Call between .Ltmp68 and .Lfunc_end4
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.byte	0                               # >> Action Record 1 <<
                                        #   Cleanup
	.byte	0                               #   No further actions
	.byte	1                               # >> Action Record 2 <<
                                        #   Catch TypeInfo 1
	.byte	125                             #   Continue to action 1
	.byte	2                               # >> Action Record 3 <<
                                        #   Catch TypeInfo 2
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 2
	.long	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE # TypeInfo 1
.Lttbase1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z15multiplyWithCPUPdS_S_
.LCPI5_0:
	.long	0x447a0000                      # float 1000
	.text
	.globl	_Z15multiplyWithCPUPdS_S_
	.type	_Z15multiplyWithCPUPdS_S_,@function
_Z15multiplyWithCPUPdS_S_:              # @_Z15multiplyWithCPUPdS_S_
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r12
	xorl	%r13d, %r13d
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
.LBB5_1:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_2 Depth 2
                                        #       Child Loop BB5_3 Depth 3
	imulq	$16000, %r13, %rax              # imm = 0x3E80
	addq	%rbx, %rax
	movq	%r14, %rcx
	xorl	%edx, %edx
.LBB5_2:                                #   Parent Loop BB5_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB5_3 Depth 3
	movq	$0, (%rax,%rdx,8)
	xorpd	%xmm0, %xmm0
	movq	%rcx, %rsi
	xorl	%edi, %edi
.LBB5_3:                                #   Parent Loop BB5_1 Depth=1
                                        #     Parent Loop BB5_2 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movsd	(%r12,%rdi,8), %xmm1            # xmm1 = mem[0],zero
	mulsd	(%rsi), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%rax,%rdx,8)
	incq	%rdi
	addq	$16000, %rsi                    # imm = 0x3E80
	cmpq	$2000, %rdi                     # imm = 0x7D0
	jne	.LBB5_3
# %bb.4:                                #   in Loop: Header=BB5_2 Depth=2
	incq	%rdx
	addq	$8, %rcx
	cmpq	$2000, %rdx                     # imm = 0x7D0
	jne	.LBB5_2
# %bb.5:                                #   in Loop: Header=BB5_1 Depth=1
	incq	%r13
	addq	$16000, %r12                    # imm = 0x3E80
	cmpq	$2000, %r13                     # imm = 0x7D0
	jne	.LBB5_1
# %bb.6:
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movabsq	$4835703278458516699, %rcx      # imm = 0x431BDE82D7B634DB
	imulq	%rcx
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$18, %rdx
	addq	%rax, %rdx
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rdx, %xmm0
	divss	.LCPI5_0(%rip), %xmm0
	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_end5:
	.size	_Z15multiplyWithCPUPdS_S_, .Lfunc_end5-_Z15multiplyWithCPUPdS_S_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z7maxDiffPdS_
.LCPI6_0:
	.quad	0x7fffffffffffffff              # double NaN
	.quad	0x7fffffffffffffff              # double NaN
	.text
	.globl	_Z7maxDiffPdS_
	.type	_Z7maxDiffPdS_,@function
_Z7maxDiffPdS_:                         # @_Z7maxDiffPdS_
	.cfi_startproc
# %bb.0:
	xorpd	%xmm0, %xmm0
	xorl	%eax, %eax
	movapd	.LCPI6_0(%rip), %xmm1           # xmm1 = [NaN,NaN]
.LBB6_1:                                # =>This Inner Loop Header: Depth=1
	movapd	%xmm0, %xmm2
	movsd	(%rdi,%rax,8), %xmm0            # xmm0 = mem[0],zero
	subsd	(%rsi,%rax,8), %xmm0
	andpd	%xmm1, %xmm0
	maxsd	%xmm2, %xmm0
	incq	%rax
	cmpq	$4000000, %rax                  # imm = 0x3D0900
	jne	.LBB6_1
# %bb.2:
	retq
.Lfunc_end6:
	.size	_Z7maxDiffPdS_, .Lfunc_end6-_Z7maxDiffPdS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z13matrixReleasePd             # -- Begin function _Z13matrixReleasePd
	.type	_Z13matrixReleasePd,@function
_Z13matrixReleasePd:                    # @_Z13matrixReleasePd
	.cfi_startproc
# %bb.0:
	testq	%rdi, %rdi
	jne	_ZdaPv                          # TAILCALL
# %bb.1:
	retq
.Lfunc_end7:
	.size	_Z13matrixReleasePd, .Lfunc_end7-_Z13matrixReleasePd
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt13random_deviceC2Ev,"axG",@progbits,_ZNSt13random_deviceC2Ev,comdat
	.weak	_ZNSt13random_deviceC2Ev        # -- Begin function _ZNSt13random_deviceC2Ev
	.p2align	1, 0x90
	.type	_ZNSt13random_deviceC2Ev,@function
_ZNSt13random_deviceC2Ev:               # @_ZNSt13random_deviceC2Ev
.Lfunc_begin2:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception2
# %bb.0:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	leaq	16(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	%rsp, %r14
	movl	$.L.str.5, %esi
	movl	$.L.str.5+7, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp70:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp71:
# %bb.1:
	movq	(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB8_3
# %bb.2:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB8_3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	addq	$32, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB8_4:
	.cfi_def_cfa_offset 64
.Ltmp72:
	movq	%rax, %rbx
	movq	(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB8_6
# %bb.5:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i4
	callq	_ZdlPv
.LBB8_6:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit6
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end8:
	.size	_ZNSt13random_deviceC2Ev, .Lfunc_end8-_ZNSt13random_deviceC2Ev
	.cfi_endproc
	.section	.gcc_except_table._ZNSt13random_deviceC2Ev,"aG",@progbits,_ZNSt13random_deviceC2Ev,comdat
	.p2align	2, 0x0
GCC_except_table8:
.Lexception2:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end2-.Lcst_begin2
.Lcst_begin2:
	.uleb128 .Lfunc_begin2-.Lfunc_begin2    # >> Call Site 1 <<
	.uleb128 .Ltmp70-.Lfunc_begin2          #   Call between .Lfunc_begin2 and .Ltmp70
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp70-.Lfunc_begin2          # >> Call Site 2 <<
	.uleb128 .Ltmp71-.Ltmp70                #   Call between .Ltmp70 and .Ltmp71
	.uleb128 .Ltmp72-.Lfunc_begin2          #     jumps to .Ltmp72
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp71-.Lfunc_begin2          # >> Call Site 3 <<
	.uleb128 .Lfunc_end8-.Ltmp71            #   Call between .Ltmp71 and .Lfunc_end8
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,"axG",@progbits,_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,comdat
	.weak	_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv # -- Begin function _ZN18MyCudaErrorHandler15MyCudaException9printInfoEv
	.p2align	1, 0x90
	.type	_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,@function
_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv: # @_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movl	12(%rdi), %eax
	cmpq	$4, %rax
	ja	.LBB9_10
# %bb.1:
	jmpq	*.LJTI9_0(,%rax,8)
.LBB9_2:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$65, %edx
	jmp	.LBB9_9
.LBB9_3:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.11, %esi
	movl	$41, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	8(%rbx), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.12, %esi
	movl	$28, %edx
	movq	%rax, %rdi
	jmp	.LBB9_9
.LBB9_4:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	jmp	.LBB9_8
.LBB9_5:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	movl	$25, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	8(%rbx), %edi
	callq	hipGetErrorString
	testq	%rax, %rax
	je	.LBB9_12
# %bb.6:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB9_13
.LBB9_7:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
.LBB9_8:
	movl	$17, %edx
	jmp	.LBB9_9
.LBB9_10:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.13, %esi
	movl	$26, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	8(%rbx), %edi
	callq	hipGetErrorString
	testq	%rax, %rax
	je	.LBB9_14
# %bb.11:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%rbx, %rsi
	movq	%rax, %rdx
.LBB9_9:
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l # TAILCALL
.LBB9_12:
	.cfi_def_cfa_offset 16
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.LBB9_13:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZNSo5flushEv                   # TAILCALL
.LBB9_14:
	.cfi_def_cfa_offset 16
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate # TAILCALL
.Lfunc_end9:
	.size	_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv, .Lfunc_end9-_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv
	.cfi_endproc
	.section	.rodata._ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,"aG",@progbits,_ZN18MyCudaErrorHandler15MyCudaException9printInfoEv,comdat
	.p2align	3, 0x0
.LJTI9_0:
	.quad	.LBB9_2
	.quad	.LBB9_7
	.quad	.LBB9_4
	.quad	.LBB9_5
	.quad	.LBB9_3
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end10:
	.size	__clang_call_terminate, .Lfunc_end10-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev,"axG",@progbits,_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev,comdat
	.weak	_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev # -- Begin function _ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev
	.p2align	1, 0x90
	.type	_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev,@function
_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev: # @_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	callq	_ZNSt9exceptionD2Ev
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZdlPv                          # TAILCALL
.Lfunc_end11:
	.size	_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev, .Lfunc_end11-_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev
	.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	.LBB12_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	.LBB12_3
.LBB12_1:                               # %._crit_edge
	movq	(%rbx), %rax
.LBB12_3:
	testq	%r14, %r14
	je	.LBB12_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB12_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB12_7
.LBB12_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB12_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_end12:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end12-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_
.LCPI13_0:
	.long	0x4f800000                      # float 4.2949673E+9
.LCPI13_1:
	.long	0x40000000                      # float 2
.LCPI13_2:
	.long	0x5f000000                      # float 9.22337203E+18
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI13_3:
	.quad	0x3ff0000000000000              # double 1
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI13_4:
	.long	1127219200                      # 0x43300000
	.long	1160773632                      # 0x45300000
	.long	0                               # 0x0
	.long	0                               # 0x0
.LCPI13_5:
	.quad	0x4330000000000000              # double 4503599627370496
	.quad	0x4530000000000000              # double 1.9342813113834067E+25
	.section	.text._ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_,"axG",@progbits,_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_,comdat
	.weak	_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_
	.type	_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_,@function
_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_: # @_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$72, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %rbx
	flds	.LCPI13_0(%rip)
	fstpt	(%rsp)
	callq	logl
	fstpt	24(%rsp)                        # 10-byte Folded Spill
	flds	.LCPI13_1(%rip)
	fstpt	(%rsp)
	callq	logl
	fldt	24(%rsp)                        # 10-byte Folded Reload
	fdivp	%st, %st(1)
	flds	.LCPI13_2(%rip)
	xorl	%ecx, %ecx
	fxch	%st(1)
	fucomi	%st(1), %st
	fldz
	fcmovnb	%st(2), %st
	fstp	%st(2)
	fsubp	%st, %st(1)
	setae	%cl
	fnstcw	20(%rsp)
	movzwl	20(%rsp), %eax
	orl	$3072, %eax                     # imm = 0xC00
	movw	%ax, 22(%rsp)
	fldcw	22(%rsp)
	fistpll	64(%rsp)
	fldcw	20(%rsp)
	shlq	$63, %rcx
	xorq	64(%rsp), %rcx
	leaq	52(%rcx), %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r14
	cmpq	$1, %rax
	adcq	$0, %r14
	xorpd	%xmm0, %xmm0
	movsd	.LCPI13_3(%rip), %xmm1          # xmm1 = mem[0],zero
.LBB13_1:                               # %select.unfold
                                        # =>This Inner Loop Header: Depth=1
	movsd	%xmm1, 40(%rsp)                 # 8-byte Spill
	movsd	%xmm0, 24(%rsp)                 # 8-byte Spill
	movq	%rbx, %rdi
	callq	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	movq	%rax, %xmm0
	punpckldq	.LCPI13_4(%rip), %xmm0  # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
	subpd	.LCPI13_5(%rip), %xmm0
	movapd	%xmm0, %xmm1
	unpckhpd	%xmm0, %xmm1                    # xmm1 = xmm1[1],xmm0[1]
	addsd	%xmm0, %xmm1
	movsd	24(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movsd	40(%rsp), %xmm2                 # 8-byte Reload
                                        # xmm2 = mem[0],zero
	mulsd	%xmm2, %xmm1
	movsd	%xmm2, 56(%rsp)
	fldl	56(%rsp)
	fmuls	.LCPI13_0(%rip)
	addsd	%xmm1, %xmm0
	fstpl	48(%rsp)
	movsd	48(%rsp), %xmm1                 # xmm1 = mem[0],zero
	decq	%r14
	jne	.LBB13_1
# %bb.2:
	divsd	%xmm1, %xmm0
	ucomisd	.LCPI13_3(%rip), %xmm0
	jae	.LBB13_4
# %bb.3:
	addq	$72, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB13_4:
	.cfi_def_cfa_offset 96
	movsd	.LCPI13_3(%rip), %xmm0          # xmm0 = mem[0],zero
	xorpd	%xmm1, %xmm1
	addq	$72, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	nextafter                       # TAILCALL
.Lfunc_end13:
	.size	_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_, .Lfunc_end13-_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,"axG",@progbits,_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,comdat
	.weak	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv # -- Begin function _ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.p2align	1, 0x90
	.type	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,@function
_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv: # @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	4992(%rdi), %rax
	cmpq	$624, %rax                      # imm = 0x270
	jb	.LBB14_2
# %bb.1:
	movq	%rbx, %rdi
	callq	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	movq	4992(%rbx), %rax
.LBB14_2:
	leaq	1(%rax), %rcx
	movq	%rcx, 4992(%rbx)
	movq	(%rbx,%rax,8), %rax
	movq	%rax, %rcx
	shrq	$11, %rcx
	movl	%ecx, %ecx
	xorq	%rax, %rcx
	movl	%ecx, %eax
	shll	$7, %eax
	andl	$-1658038656, %eax              # imm = 0x9D2C5680
	xorq	%rcx, %rax
	movl	%eax, %ecx
	shll	$15, %ecx
	andl	$-272236544, %ecx               # imm = 0xEFC60000
	xorq	%rax, %rcx
	movq	%rcx, %rax
	shrq	$18, %rax
	xorq	%rcx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end14:
	.size	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv, .Lfunc_end14-_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,"axG",@progbits,_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,comdat
	.weak	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv # -- Begin function _ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.p2align	1, 0x90
	.type	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,@function
_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv: # @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.cfi_startproc
# %bb.0:
	movl	$2567483615, %eax               # imm = 0x9908B0DF
	movq	(%rdi), %rdx
	xorl	%ecx, %ecx
.LBB15_1:                               # =>This Inner Loop Header: Depth=1
	andq	$-2147483648, %rdx              # imm = 0x80000000
	movq	8(%rdi,%rcx,8), %rsi
	movl	%esi, %r8d
	andl	$2147483646, %r8d               # imm = 0x7FFFFFFE
	orq	%rdx, %r8
	shrq	%r8
	xorq	3176(%rdi,%rcx,8), %r8
	movq	%rsi, %rdx
                                        # kill: def $esi killed $esi killed $rsi def $rsi
	andl	$1, %esi
	negl	%esi
	andl	%eax, %esi
	xorq	%r8, %rsi
	movq	%rsi, (%rdi,%rcx,8)
	leaq	1(%rcx), %rsi
	movq	%rsi, %rcx
	cmpq	$227, %rsi
	jne	.LBB15_1
# %bb.2:                                # %.preheader.preheader
	movq	1816(%rdi), %rdx
	movl	$228, %ecx
.LBB15_3:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	andq	$-2147483648, %rdx              # imm = 0x80000000
	movq	(%rdi,%rcx,8), %rsi
	movl	%esi, %r8d
	andl	$2147483646, %r8d               # imm = 0x7FFFFFFE
	orq	%rdx, %r8
	shrq	%r8
	xorq	-1824(%rdi,%rcx,8), %r8
	movq	%rsi, %rdx
                                        # kill: def $esi killed $esi killed $rsi def $rsi
	andl	$1, %esi
	negl	%esi
	andl	%eax, %esi
	xorq	%r8, %rsi
	movq	%rsi, -8(%rdi,%rcx,8)
	incq	%rcx
	cmpq	$624, %rcx                      # imm = 0x270
	jne	.LBB15_3
# %bb.4:
	movq	$-2147483648, %rcx              # imm = 0x80000000
	andq	4984(%rdi), %rcx
	movq	(%rdi), %rdx
	movl	%edx, %esi
	andl	$2147483646, %esi               # imm = 0x7FFFFFFE
	orq	%rcx, %rsi
	shrq	%rsi
	xorq	3168(%rdi), %rsi
	andl	$1, %edx
	negl	%edx
	andl	%eax, %edx
	xorq	%rsi, %rdx
	movq	%rdx, 4984(%rdi)
	movq	$0, 4992(%rdi)
	retq
.Lfunc_end15:
	.size	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv, .Lfunc_end15-_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB16_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB16_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14multiplyKernelPdS_S_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end16:
	.size	__hip_module_ctor, .Lfunc_end16-__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	.LBB17_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
.LBB17_2:
	retq
.Lfunc_end17:
	.size	__hip_module_dtor, .Lfunc_end17-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_ZTSN18MyCudaErrorHandler15MyCudaExceptionE,@object # @_ZTSN18MyCudaErrorHandler15MyCudaExceptionE
	.section	.rodata._ZTSN18MyCudaErrorHandler15MyCudaExceptionE,"aG",@progbits,_ZTSN18MyCudaErrorHandler15MyCudaExceptionE,comdat
	.weak	_ZTSN18MyCudaErrorHandler15MyCudaExceptionE
_ZTSN18MyCudaErrorHandler15MyCudaExceptionE:
	.asciz	"N18MyCudaErrorHandler15MyCudaExceptionE"
	.size	_ZTSN18MyCudaErrorHandler15MyCudaExceptionE, 40

	.type	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE,@object # @_ZTIN18MyCudaErrorHandler15MyCudaExceptionE
	.section	.rodata._ZTIN18MyCudaErrorHandler15MyCudaExceptionE,"aG",@progbits,_ZTIN18MyCudaErrorHandler15MyCudaExceptionE,comdat
	.weak	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE
	.p2align	3, 0x0
_ZTIN18MyCudaErrorHandler15MyCudaExceptionE:
	.quad	_ZTVN10__cxxabiv120__si_class_type_infoE+16
	.quad	_ZTSN18MyCudaErrorHandler15MyCudaExceptionE
	.quad	_ZTISt9exception
	.size	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE, 24

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Started, matrix size - "
	.size	.L.str, 24

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	", gpu block size: "
	.size	.L.str.1, 19

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"GPU elapsed time (in seconds): "
	.size	.L.str.2, 32

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"CPU elapsed time (in seconds): "
	.size	.L.str.3, 32

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Max diff: "
	.size	.L.str.4, 11

	.type	_ZTVN18MyCudaErrorHandler15MyCudaExceptionE,@object # @_ZTVN18MyCudaErrorHandler15MyCudaExceptionE
	.section	.rodata._ZTVN18MyCudaErrorHandler15MyCudaExceptionE,"aG",@progbits,_ZTVN18MyCudaErrorHandler15MyCudaExceptionE,comdat
	.weak	_ZTVN18MyCudaErrorHandler15MyCudaExceptionE
	.p2align	3, 0x0
_ZTVN18MyCudaErrorHandler15MyCudaExceptionE:
	.quad	0
	.quad	_ZTIN18MyCudaErrorHandler15MyCudaExceptionE
	.quad	_ZNSt9exceptionD2Ev
	.quad	_ZN18MyCudaErrorHandler15MyCudaExceptionD0Ev
	.quad	_ZNKSt9exception4whatEv
	.size	_ZTVN18MyCudaErrorHandler15MyCudaExceptionE, 40

	.type	.L.str.5,@object                # @.str.5
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.5:
	.asciz	"default"
	.size	.L.str.5, 8

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"\nhipSetDevice failed!\n Do you have a CUDA-capable GPU installed?\n"
	.size	.L.str.7, 66

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"hipMalloc failed!"
	.size	.L.str.8, 18

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"hipMemcpy failed!"
	.size	.L.str.9, 18

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"addKernel launch failed: "
	.size	.L.str.10, 26

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"hipDeviceSynchronize returned error code "
	.size	.L.str.11, 42

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	" after launching addKernel!\n"
	.size	.L.str.12, 29

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Unsupported error type!!!\n"
	.size	.L.str.13, 27

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

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

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym _Z29__device_stub__multiplyKernelPdS_S_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZTVN10__cxxabiv120__si_class_type_infoE
	.addrsig_sym _ZTSN18MyCudaErrorHandler15MyCudaExceptionE
	.addrsig_sym _ZTISt9exception
	.addrsig_sym _ZTIN18MyCudaErrorHandler15MyCudaExceptionE
	.addrsig_sym _Z14multiplyKernelPdS_S_
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z14multiplyKernelPdS_S_ ; -- Begin function _Z14multiplyKernelPdS_S_
	.globl	_Z14multiplyKernelPdS_S_
	.p2align	8
	.type	_Z14multiplyKernelPdS_S_,@function
_Z14multiplyKernelPdS_S_:               ; @_Z14multiplyKernelPdS_S_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x24
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v2, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[4:5], null, s15, s3, v[1:2]
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	s_mov_b32 s2, exec_lo
	v_max_u32_e32 v1, v4, v0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u32_e32 0x7d0, v1
	s_cbranch_execz .LBB0_3
; %bb.1:
	s_clause 0x1
	s_load_b64 s[4:5], s[0:1], 0x10
	s_load_b128 s[0:3], s[0:1], 0x0
	v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v2, 0
	v_mov_b32_e32 v3, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_lshlrev_b64 v[9:10], 3, v[0:1]
	v_mov_b32_e32 v0, v1
	s_waitcnt lgkmcnt(0)
	v_mad_u64_u32 v[7:8], null, 0x3e80, v4, s[4:5]
	v_mad_u64_u32 v[5:6], null, 0x3e80, v4, s[0:1]
	s_mov_b64 s[0:1], 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v7, vcc_lo, v7, v9
	v_add_co_ci_u32_e32 v8, vcc_lo, v8, v10, vcc_lo
	v_add_co_u32 v9, vcc_lo, s2, v9
	v_add_co_ci_u32_e32 v10, vcc_lo, s3, v10, vcc_lo
	global_store_b64 v[7:8], v[0:1], off
.LBB0_2:                                ; =>This Inner Loop Header: Depth=1
	v_add_co_u32 v0, vcc_lo, v5, s0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v6, vcc_lo
	s_add_u32 s0, s0, 8
	s_addc_u32 s1, s1, 0
	global_load_b64 v[11:12], v[9:10], off
	global_load_b64 v[0:1], v[0:1], off
	v_add_co_u32 v9, vcc_lo, 0x3e80, v9
	v_add_co_ci_u32_e32 v10, vcc_lo, 0, v10, vcc_lo
	s_cmp_lg_u64 s[0:1], 0x3e80
	s_waitcnt vmcnt(0)
	v_fma_f64 v[2:3], v[0:1], v[11:12], v[2:3]
	global_store_b64 v[7:8], v[2:3], off
	s_cbranch_scc1 .LBB0_2
.LBB0_3:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14multiplyKernelPdS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 13
		.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	_Z14multiplyKernelPdS_S_, .Lfunc_end0-_Z14multiplyKernelPdS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 296
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
