/*******************************************************************************
 * Copyright (C) 2019 Marvin Löbel <loebel.marvin@gmail.com>
 * Copyright (C) 2019 Oliver Magiera <oliver.magiera@tu-dortmund.de>
 *
 * All rights reserved. Published under the BSD-3 license in the LICENSE file.
 ******************************************************************************/

#include<iostream>
#include<cstdint>
#include<cstddef>

#include "cuda_util.cuh"

#define map_single_error_code(e) case e: out << #e; break;

static void map_error_code(cudaError e, std::ostream& out) {
    switch (e) {
    map_single_error_code(cudaErrorMissingConfiguration)
    map_single_error_code(cudaErrorMemoryAllocation)
    map_single_error_code(cudaErrorInitializationError)
    map_single_error_code(cudaErrorLaunchFailure)
    map_single_error_code(cudaErrorPriorLaunchFailure)
    map_single_error_code(cudaErrorLaunchTimeout)
    map_single_error_code(cudaErrorLaunchOutOfResources)
    map_single_error_code(cudaErrorInvalidDeviceFunction)
    map_single_error_code(cudaErrorInvalidConfiguration)
    map_single_error_code(cudaErrorInvalidDevice)
    map_single_error_code(cudaErrorInvalidValue)
    map_single_error_code(cudaErrorInvalidPitchValue)
    map_single_error_code(cudaErrorInvalidSymbol)
    map_single_error_code(cudaErrorMapBufferObjectFailed)
    map_single_error_code(cudaErrorUnmapBufferObjectFailed)
    map_single_error_code(cudaErrorInvalidHostPointer)
    map_single_error_code(cudaErrorInvalidDevicePointer)
    map_single_error_code(cudaErrorInvalidTexture)
    map_single_error_code(cudaErrorInvalidTextureBinding)
    map_single_error_code(cudaErrorInvalidChannelDescriptor)
    map_single_error_code(cudaErrorInvalidMemcpyDirection)
    map_single_error_code(cudaErrorAddressOfConstant)
    map_single_error_code(cudaErrorTextureFetchFailed)
    map_single_error_code(cudaErrorTextureNotBound)
    map_single_error_code(cudaErrorSynchronizationError)
    map_single_error_code(cudaErrorInvalidFilterSetting)
    map_single_error_code(cudaErrorInvalidNormSetting)
    map_single_error_code(cudaErrorMixedDeviceExecution)
    map_single_error_code(cudaErrorCudartUnloading)
    map_single_error_code(cudaErrorUnknown)
    map_single_error_code(cudaErrorNotYetImplemented)
    map_single_error_code(cudaErrorMemoryValueTooLarge)
    map_single_error_code(cudaErrorInvalidResourceHandle)
    map_single_error_code(cudaErrorNotReady)
    map_single_error_code(cudaErrorInsufficientDriver)
    map_single_error_code(cudaErrorSetOnActiveProcess)
    map_single_error_code(cudaErrorInvalidSurface)
    map_single_error_code(cudaErrorNoDevice)
    map_single_error_code(cudaErrorECCUncorrectable)
    map_single_error_code(cudaErrorSharedObjectSymbolNotFound)
    map_single_error_code(cudaErrorSharedObjectInitFailed)
    map_single_error_code(cudaErrorUnsupportedLimit)
    map_single_error_code(cudaErrorDuplicateVariableName)
    map_single_error_code(cudaErrorDuplicateTextureName)
    map_single_error_code(cudaErrorDuplicateSurfaceName)
    map_single_error_code(cudaErrorDevicesUnavailable)
    map_single_error_code(cudaErrorInvalidKernelImage)
    map_single_error_code(cudaErrorNoKernelImageForDevice)
    map_single_error_code(cudaErrorIncompatibleDriverContext)
    map_single_error_code(cudaErrorPeerAccessAlreadyEnabled)
    map_single_error_code(cudaErrorPeerAccessNotEnabled)
    map_single_error_code(cudaErrorDeviceAlreadyInUse)
    map_single_error_code(cudaErrorProfilerDisabled)
    map_single_error_code(cudaErrorProfilerNotInitialized)
    map_single_error_code(cudaErrorProfilerAlreadyStarted)
    map_single_error_code(cudaErrorProfilerAlreadyStopped)
    map_single_error_code(cudaErrorStartupFailure)
    map_single_error_code(cudaErrorApiFailureBase)
    map_single_error_code(cudaErrorIllegalAddress)
    default:
        out << "unknown code " << int(e);
    }
}

void cuda_check_internal(char const* file, int line, cudaError v, char const* reason) {
    if (v != cudaSuccess) {
        std::cerr << "CUDA ERROR at " << file << ":" << line << ": ";
        map_error_code(v, std::cerr);
        if (std::string(reason) != "") {
            std::cerr << " (" << reason << ")" << std::endl;
        }
        std::abort();
    }
}

	.file	"tmpxft_002d917d_00000000-6_cuda_util.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3639:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3639:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"CUDA ERROR at "
.LC1:
	.string	":"
.LC2:
	.string	": "
.LC3:
	.string	"cudaErrorMissingConfiguration"
.LC4:
	.string	"cudaErrorMemoryAllocation"
.LC5:
	.string	"cudaErrorInitializationError"
.LC6:
	.string	"cudaErrorLaunchFailure"
.LC7:
	.string	"cudaErrorPriorLaunchFailure"
.LC8:
	.string	"cudaErrorLaunchTimeout"
.LC9:
	.string	"cudaErrorLaunchOutOfResources"
.LC10:
	.string	"cudaErrorInvalidDeviceFunction"
.LC11:
	.string	"cudaErrorInvalidConfiguration"
.LC12:
	.string	"cudaErrorInvalidDevice"
.LC13:
	.string	"cudaErrorInvalidValue"
.LC14:
	.string	"cudaErrorInvalidPitchValue"
.LC15:
	.string	"cudaErrorInvalidSymbol"
.LC16:
	.string	"cudaErrorMapBufferObjectFailed"
.LC17:
	.string	"cudaErrorUnmapBufferObjectFailed"
.LC18:
	.string	"cudaErrorInvalidHostPointer"
.LC19:
	.string	"cudaErrorInvalidDevicePointer"
.LC20:
	.string	"cudaErrorInvalidTexture"
.LC21:
	.string	"cudaErrorInvalidTextureBinding"
.LC22:
	.string	"cudaErrorInvalidChannelDescriptor"
.LC23:
	.string	"cudaErrorInvalidMemcpyDirection"
.LC24:
	.string	"cudaErrorAddressOfConstant"
.LC25:
	.string	"cudaErrorTextureFetchFailed"
.LC26:
	.string	"cudaErrorTextureNotBound"
.LC27:
	.string	"cudaErrorSynchronizationError"
.LC28:
	.string	"cudaErrorInvalidFilterSetting"
.LC29:
	.string	"cudaErrorInvalidNormSetting"
.LC30:
	.string	"cudaErrorMixedDeviceExecution"
.LC31:
	.string	"cudaErrorCudartUnloading"
.LC32:
	.string	"cudaErrorUnknown"
.LC33:
	.string	"cudaErrorNotYetImplemented"
.LC34:
	.string	"cudaErrorMemoryValueTooLarge"
.LC35:
	.string	"cudaErrorInvalidResourceHandle"
.LC36:
	.string	"cudaErrorNotReady"
.LC37:
	.string	"cudaErrorInsufficientDriver"
.LC38:
	.string	"cudaErrorSetOnActiveProcess"
.LC39:
	.string	"cudaErrorInvalidSurface"
.LC40:
	.string	"cudaErrorNoDevice"
.LC41:
	.string	"cudaErrorECCUncorrectable"
.LC42:
	.string	"cudaErrorSharedObjectSymbolNotFound"
.LC43:
	.string	"cudaErrorSharedObjectInitFailed"
.LC44:
	.string	"cudaErrorUnsupportedLimit"
.LC45:
	.string	"cudaErrorDuplicateVariableName"
.LC46:
	.string	"cudaErrorDuplicateTextureName"
.LC47:
	.string	"cudaErrorDuplicateSurfaceName"
.LC48:
	.string	"cudaErrorDevicesUnavailable"
.LC49:
	.string	"cudaErrorInvalidKernelImage"
.LC50:
	.string	"cudaErrorNoKernelImageForDevice"
.LC51:
	.string	"cudaErrorIncompatibleDriverContext"
.LC52:
	.string	"cudaErrorPeerAccessAlreadyEnabled"
.LC53:
	.string	"cudaErrorPeerAccessNotEnabled"
.LC54:
	.string	"cudaErrorDeviceAlreadyInUse"
.LC55:
	.string	"cudaErrorProfilerDisabled"
.LC56:
	.string	"cudaErrorProfilerNotInitialized"
.LC57:
	.string	"cudaErrorProfilerAlreadyStarted"
.LC58:
	.string	"cudaErrorProfilerAlreadyStopped"
.LC59:
	.string	"cudaErrorStartupFailure"
.LC60:
	.string	"cudaErrorApiFailureBase"
.LC61:
	.string	"cudaErrorIllegalAddress"
.LC62:
	.string	"unknown code "
.LC63:
	.string	"basic_string: construction from null is not valid"
.LC64:
	.string	" ("
.LC65:
	.string	")"
	.text
	.globl	_Z19cuda_check_internalPKci9cudaErrorS0_
	.type	_Z19cuda_check_internalPKci9cudaErrorS0_, @function
_Z19cuda_check_internalPKci9cudaErrorS0_:
.LFB3636:
	.cfi_startproc
	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	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	testl	%edx, %edx
	je	.L2
	leaq	_ZSt4cerr(%rip), %rbx
	movq	%rdi, %r14
	movl	%esi, %r13d
	movl	%edx, %ebp
	leaq	.LC0(%rip), %rsi
	movq	%rbx, %rdi
	movq	%rcx, %r12
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpl	$101, %ebp
	ja	.L88
	leal	-1(%rbp), %eax
	cmpl	$100, %eax
	ja	.L6
	leaq	.L24(%rip), %rdx
	movslq	(%rdx,%rax,4), %rax
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L24:
	.long	.L61-.L24
	.long	.L60-.L24
	.long	.L59-.L24
	.long	.L58-.L24
	.long	.L57-.L24
	.long	.L56-.L24
	.long	.L55-.L24
	.long	.L54-.L24
	.long	.L53-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L52-.L24
	.long	.L51-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L50-.L24
	.long	.L49-.L24
	.long	.L48-.L24
	.long	.L47-.L24
	.long	.L46-.L24
	.long	.L45-.L24
	.long	.L44-.L24
	.long	.L43-.L24
	.long	.L42-.L24
	.long	.L41-.L24
	.long	.L40-.L24
	.long	.L39-.L24
	.long	.L38-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L37-.L24
	.long	.L36-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L35-.L24
	.long	.L6-.L24
	.long	.L34-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L33-.L24
	.long	.L32-.L24
	.long	.L31-.L24
	.long	.L30-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L29-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L28-.L24
	.long	.L27-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L6-.L24
	.long	.L26-.L24
	.long	.L6-.L24
	.long	.L25-.L24
	.long	.L23-.L24
	.text
.L88:
	cmpl	$400, %ebp
	je	.L62
	ja	.L63
	cmpl	$216, %ebp
	ja	.L64
	cmpl	$199, %ebp
	jbe	.L89
	leal	-200(%rbp), %eax
	cmpl	$16, %eax
	ja	.L6
	leaq	.L16(%rip), %rdx
	movslq	(%rdx,%rax,4), %rax
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L16:
	.long	.L22-.L16
	.long	.L6-.L16
	.long	.L6-.L16
	.long	.L6-.L16
	.long	.L6-.L16
	.long	.L21-.L16
	.long	.L20-.L16
	.long	.L6-.L16
	.long	.L6-.L16
	.long	.L19-.L16
	.long	.L6-.L16
	.long	.L6-.L16
	.long	.L6-.L16
	.long	.L6-.L16
	.long	.L18-.L16
	.long	.L17-.L16
	.long	.L15-.L16
	.text
.L89:
	leaq	.LC59(%rip), %rsi
	cmpl	$127, %ebp
	je	.L85
	jmp	.L6
.L64:
	cmpl	$302, %ebp
	je	.L67
	leaq	.LC43(%rip), %rsi
	cmpl	$303, %ebp
	je	.L85
	jmp	.L6
.L63:
	cmpl	$719, %ebp
	ja	.L69
	cmpl	$699, %ebp
	jbe	.L90
	leal	-700(%rbp), %eax
	cmpl	$19, %eax
	ja	.L6
	leaq	.L8(%rip), %rdx
	movslq	(%rdx,%rax,4), %rax
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L8:
	.long	.L14-.L8
	.long	.L13-.L8
	.long	.L12-.L8
	.long	.L6-.L8
	.long	.L11-.L8
	.long	.L10-.L8
	.long	.L6-.L8
	.long	.L6-.L8
	.long	.L9-.L8
	.long	.L6-.L8
	.long	.L6-.L8
	.long	.L6-.L8
	.long	.L6-.L8
	.long	.L6-.L8
	.long	.L6-.L8
	.long	.L6-.L8
	.long	.L6-.L8
	.long	.L6-.L8
	.long	.L6-.L8
	.long	.L7-.L8
	.text
.L90:
	leaq	.LC36(%rip), %rsi
	cmpl	$600, %ebp
	je	.L85
	jmp	.L6
.L69:
	cmpl	$999, %ebp
	je	.L72
	leaq	.LC60(%rip), %rsi
	cmpl	$10000, %ebp
	je	.L85
	jmp	.L6
.L28:
	leaq	.LC3(%rip), %rsi
	jmp	.L85
.L60:
	leaq	.LC4(%rip), %rsi
.L85:
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L74
.L59:
	leaq	.LC5(%rip), %rsi
	jmp	.L85
.L7:
	leaq	.LC6(%rip), %rsi
	jmp	.L85
.L27:
	leaq	.LC7(%rip), %rsi
	jmp	.L85
.L12:
	leaq	.LC8(%rip), %rsi
	jmp	.L85
.L13:
	leaq	.LC9(%rip), %rsi
	jmp	.L85
.L26:
	leaq	.LC10(%rip), %rsi
	jmp	.L85
.L53:
	leaq	.LC11(%rip), %rsi
	jmp	.L85
.L23:
	leaq	.LC12(%rip), %rsi
	jmp	.L85
.L61:
	leaq	.LC13(%rip), %rsi
	jmp	.L85
.L52:
	leaq	.LC14(%rip), %rsi
	jmp	.L85
.L51:
	leaq	.LC15(%rip), %rsi
	jmp	.L85
.L21:
	leaq	.LC16(%rip), %rsi
	jmp	.L85
.L20:
	leaq	.LC17(%rip), %rsi
	jmp	.L85
.L50:
	leaq	.LC18(%rip), %rsi
	jmp	.L85
.L49:
	leaq	.LC19(%rip), %rsi
	jmp	.L85
.L48:
	leaq	.LC20(%rip), %rsi
	jmp	.L85
.L47:
	leaq	.LC21(%rip), %rsi
	jmp	.L85
.L46:
	leaq	.LC22(%rip), %rsi
	jmp	.L85
.L45:
	leaq	.LC23(%rip), %rsi
	jmp	.L85
.L44:
	leaq	.LC24(%rip), %rsi
	jmp	.L85
.L43:
	leaq	.LC25(%rip), %rsi
	jmp	.L85
.L42:
	leaq	.LC26(%rip), %rsi
	jmp	.L85
.L41:
	leaq	.LC27(%rip), %rsi
	jmp	.L85
.L40:
	leaq	.LC28(%rip), %rsi
	jmp	.L85
.L39:
	leaq	.LC29(%rip), %rsi
	jmp	.L85
.L38:
	leaq	.LC30(%rip), %rsi
	jmp	.L85
.L58:
	leaq	.LC31(%rip), %rsi
	jmp	.L85
.L72:
	leaq	.LC32(%rip), %rsi
	jmp	.L85
.L37:
	leaq	.LC33(%rip), %rsi
	jmp	.L85
.L36:
	leaq	.LC34(%rip), %rsi
	jmp	.L85
.L62:
	leaq	.LC35(%rip), %rsi
	jmp	.L85
.L35:
	leaq	.LC37(%rip), %rsi
	jmp	.L85
.L9:
	leaq	.LC38(%rip), %rsi
	jmp	.L85
.L34:
	leaq	.LC39(%rip), %rsi
	jmp	.L85
.L25:
	leaq	.LC40(%rip), %rsi
	jmp	.L85
.L18:
	leaq	.LC41(%rip), %rsi
	jmp	.L85
.L67:
	leaq	.LC42(%rip), %rsi
	jmp	.L85
.L17:
	leaq	.LC44(%rip), %rsi
	jmp	.L85
.L33:
	leaq	.LC45(%rip), %rsi
	jmp	.L85
.L32:
	leaq	.LC46(%rip), %rsi
	jmp	.L85
.L31:
	leaq	.LC47(%rip), %rsi
	jmp	.L85
.L30:
	leaq	.LC48(%rip), %rsi
	jmp	.L85
.L22:
	leaq	.LC49(%rip), %rsi
	jmp	.L85
.L19:
	leaq	.LC50(%rip), %rsi
	jmp	.L85
.L29:
	leaq	.LC51(%rip), %rsi
	jmp	.L85
.L11:
	leaq	.LC52(%rip), %rsi
	jmp	.L85
.L10:
	leaq	.LC53(%rip), %rsi
	jmp	.L85
.L15:
	leaq	.LC54(%rip), %rsi
	jmp	.L85
.L57:
	leaq	.LC55(%rip), %rsi
	jmp	.L85
.L56:
	leaq	.LC56(%rip), %rsi
	jmp	.L85
.L55:
	leaq	.LC57(%rip), %rsi
	jmp	.L85
.L54:
	leaq	.LC58(%rip), %rsi
	jmp	.L85
.L14:
	leaq	.LC61(%rip), %rsi
	jmp	.L85
.L6:
	leaq	.LC62(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
.L74:
	leaq	24(%rsp), %rax
	leaq	8(%rsp), %rbp
	movq	%rax, 8(%rsp)
	testq	%r12, %r12
	jne	.L75
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L86
	leaq	.LC63(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L75:
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	(%r12,%rax), %r13
	cmpq	$15, %rax
	jbe	.L77
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, 8(%rsp)
	movq	(%rsp), %rax
	movq	%rax, 24(%rsp)
.L77:
	movq	8(%rsp), %rdi
	movq	%r13, %rdx
	movq	%r12, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	8(%rsp), %rdx
	movq	%rbp, %rdi
	movq	%rax, 16(%rsp)
	movb	$0, (%rdx,%rax)
	movq	16(%rsp), %r13
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	testq	%r13, %r13
	je	.L78
	leaq	.LC64(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC65(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.L78:
	call	abort@PLT
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L79
.L86:
	call	__stack_chk_fail@PLT
.L79:
	addq	$48, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3636:
	.size	_Z19cuda_check_internalPKci9cudaErrorS0_, .-_Z19cuda_check_internalPKci9cudaErrorS0_
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3662:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3662:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.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:

/*******************************************************************************
 * Copyright (C) 2019 Marvin Löbel <loebel.marvin@gmail.com>
 *
 * All rights reserved. Published under the BSD-3 license in the LICENSE file.
 ******************************************************************************/


#include <hip/hip_runtime.h>

void cuda_check_internal(char const* file, int line, hipError_t v, char const* reason = "");

#define cuda_check(...) cuda_check_internal(__FILE__, __LINE__, __VA_ARGS__)

	.text
	.file	"cuda_util.hip"
	.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 __hip_cuid_

	.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_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
