#include "csv_data.cuh"

CSV_Data::CSV_Data(string fileName, bool printInfo) {
    (this->resultFile).open(fileName, ios::out);
    (this->resultFile) << "Target,#Threads,#ThreadBlks,ExecTime\n";
    this->printInfo = printInfo;
}


CSV_Data::~CSV_Data() {
    resultFile.close();
}


void CSV_Data::AddData(string Target, int numThreads, int numThreadBlks, float ExecTime) {
    if (printInfo) {
        printf("[INFO] Target: %10s, numThreads: %5d, numThreadBlks: %5d, ExecTime: %.5f\n",
                Target.c_str(), numThreads, numThreadBlks, ExecTime);
    }
    (this->resultFile) << Target << "," << numThreads << "," << numThreadBlks << "," << ExecTime << "\n";
}


bool CSV_Data::CompareDeviceData(void *device_result, size_t device_result_size) {
    if (this->host_result == NULL) {
        printf("[WARN] Host result data is empty.\n");
        return false;
    }
    if (this->host_result_size == device_result_size) {
        if (memcmp(device_result, this->host_result, device_result_size) == 0) {
            return true;
        } else {
            printf("[WARN] Data is not matching with host's and device's.\n");
            return false;
        }
    } else {
        printf("[WARN] Data size is not matching with host's and device's.\n"
               "        Device: %lu, Host: %lu\n", device_result_size, this->host_result_size);
        return false;
    }
}


void CSV_Data::AddHostData(float ExecTime, void *host_result, size_t host_result_size) {
    this->host_exec_time = ExecTime;
    if (this->host_result) {
        free(this->host_result);
    }
    this->host_result = (void *)malloc(host_result_size);
    this->host_result_size = host_result_size;
    memcpy(this->host_result, host_result, host_result_size);
    this->AddData("host", 1, 1, ExecTime);
}


void CSV_Data::AddDeviceData(int numThreads, int numThreadBlks, float ExecTime, void *device_result, size_t device_result_size) {
    this->CompareDeviceData(device_result, device_result_size);
    this->AddData("device", numThreads, numThreadBlks, ExecTime);
}

	.file	"tmpxft_002050e5_00000000-6_csv_data.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3778:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3778:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"[INFO] Target: %10s, numThreads: %5d, numThreadBlks: %5d, ExecTime: %.5f\n"
.LC1:
	.string	","
.LC2:
	.string	"\n"
	.text
	.align 2
	.globl	_ZN8CSV_Data7AddDataENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiif
	.type	_ZN8CSV_Data7AddDataENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiif, @function
_ZN8CSV_Data7AddDataENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiif:
.LFB3772:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	cvtss2sd	%xmm0, %xmm1
	movq	%xmm1, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	cmpb	$0, 512(%rdi)
	movl	%ecx, %ebx
	je	.L3
	movl	%ecx, %r8d
	movl	%edx, %ecx
	movq	(%rsi), %rdx
	movaps	%xmm1, %xmm0
	leaq	.LC0(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	leaq	.LC1(%rip), %r12
	call	_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r14, %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	popq	%rbx
	.cfi_def_cfa_offset 40
	leaq	.LC2(%rip), %rsi
	popq	%rbp
	.cfi_def_cfa_offset 32
	movq	%rax, %rdi
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	.cfi_endproc
.LFE3772:
	.size	_ZN8CSV_Data7AddDataENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiif, .-_ZN8CSV_Data7AddDataENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiif
	.section	.rodata.str1.1
.LC3:
	.string	"[WARN] Host result data is empty.\n"
.LC4:
	.string	"[WARN] Data is not matching with host's and device's.\n"
.LC5:
	.string	"[WARN] Data size is not matching with host's and device's.\n        Device: %lu, Host: %lu\n"
	.text
	.align 2
	.globl	_ZN8CSV_Data17CompareDeviceDataEPvm
	.type	_ZN8CSV_Data17CompareDeviceDataEPvm, @function
_ZN8CSV_Data17CompareDeviceDataEPvm:
.LFB3773:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rsi, %rdi
	pushq	%rcx
	.cfi_def_cfa_offset 16
	movq	520(%rax), %rsi
	testq	%rsi, %rsi
	jne	.L7
	leaq	.LC3(%rip), %rsi
	jmp	.L14
.L7:
	movq	528(%rax), %rcx
	cmpq	%rdx, %rcx
	jne	.L9
	movq	%rcx, %rdx
	call	memcmp@PLT
	movl	%eax, %edx
	movb	$1, %al
	testl	%edx, %edx
	je	.L6
	leaq	.LC4(%rip), %rsi
.L14:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	xorl	%eax, %eax
	jmp	.L6
.L9:
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
.L6:
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3773:
	.size	_ZN8CSV_Data17CompareDeviceDataEPvm, .-_ZN8CSV_Data17CompareDeviceDataEPvm
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3801:
	.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
.LFE3801:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC6:
	.string	"Target,#Threads,#ThreadBlks,ExecTime\n"
	.text
	.align 2
	.globl	_ZN8CSV_DataC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb
	.type	_ZN8CSV_DataC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb, @function
_ZN8CSV_DataC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb:
.LFB3767:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3767
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
.LEHB0:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE0:
	xorl	%eax, %eax
	movq	(%r12), %rsi
	leaq	8(%rbx), %rdi
	movq	%rax, 520(%rbx)
	movl	$16, %edx
.LEHB1:
	call	_ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	movq	(%rbx), %rdx
	movq	-24(%rdx), %rdi
	addq	%rbx, %rdi
	testq	%rax, %rax
	jne	.L18
	movl	$4, %esi
	call	_ZNSt9basic_iosIcSt11char_traitsIcEE8setstateESt12_Ios_Iostate@PLT
	jmp	.L19
.L18:
	xorl	%esi, %esi
	call	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate@PLT
.L19:
	leaq	.LC6(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.LEHE1:
	movb	%bpl, 512(%rbx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	endbr64
	movq	%rax, %rbp
.L20:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	%rbp, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
	.cfi_endproc
.LFE3767:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3767:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3767-.LLSDACSB3767
.LLSDACSB3767:
	.uleb128 .LEHB0-.LFB3767
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3767
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L21-.LFB3767
	.uleb128 0
	.uleb128 .LEHB2-.LFB3767
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE3767:
	.text
	.size	_ZN8CSV_DataC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb, .-_ZN8CSV_DataC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb
	.globl	_ZN8CSV_DataC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb
	.set	_ZN8CSV_DataC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb,_ZN8CSV_DataC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb
	.align 2
	.globl	_ZN8CSV_DataD2Ev
	.type	_ZN8CSV_DataD2Ev, @function
_ZN8CSV_DataD2Ev:
.LFB3770:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3770
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movq	%rdi, 8(%rsp)
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
	movq	8(%rsp), %rdi
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	jmp	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	.cfi_endproc
.LFE3770:
	.section	.gcc_except_table
.LLSDA3770:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3770-.LLSDACSB3770
.LLSDACSB3770:
.LLSDACSE3770:
	.text
	.size	_ZN8CSV_DataD2Ev, .-_ZN8CSV_DataD2Ev
	.globl	_ZN8CSV_DataD1Ev
	.set	_ZN8CSV_DataD1Ev,_ZN8CSV_DataD2Ev
	.section	.rodata._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.str1.1,"aMS",@progbits,1
.LC7:
	.string	"basic_string: construction from null is not valid"
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_,comdat
	.align 2
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_:
.LFB4130:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	jne	.L27
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	leaq	.LC7(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L27:
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	%rsi, %rbp
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	0(%rbp,%rax), %r12
	cmpq	$15, %rax
	jbe	.L29
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, (%rbx)
	movq	(%rsp), %rax
	movq	%rax, 16(%rbx)
.L29:
	movq	(%rbx), %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	(%rbx), %rdx
	movq	%rax, 8(%rbx)
	movb	$0, (%rdx,%rax)
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L30
.L32:
	call	__stack_chk_fail@PLT
.L30:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4130:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	.set	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.section	.rodata.str1.1
.LC8:
	.string	"host"
	.text
	.align 2
	.globl	_ZN8CSV_Data11AddHostDataEfPvm
	.type	_ZN8CSV_Data11AddHostDataEfPvm, @function
_ZN8CSV_Data11AddHostDataEfPvm:
.LFB3774:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3774
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movd	%xmm0, %r14d
	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
	movq	%rdi, %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movss	%xmm0, 516(%rdi)
	movq	520(%rdi), %rdi
	testq	%rdi, %rdi
	je	.L34
	call	free@PLT
.L34:
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rcx
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%rbp, 528(%rbx)
	movq	%rax, %rdi
	leaq	8(%rsp), %rbp
	movq	%rax, 520(%rbx)
	call	__memcpy_chk@PLT
	leaq	7(%rsp), %rdx
	leaq	.LC8(%rip), %rsi
	movq	%rbp, %rdi
.LEHB3:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE3:
	movd	%r14d, %xmm0
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	movl	$1, %ecx
	movl	$1, %edx
.LEHB4:
	call	_ZN8CSV_Data7AddDataENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiif
.LEHE4:
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L37
	jmp	.L42
.L38:
	endbr64
	movq	%rax, %rbx
.L35:
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	movq	%rbx, %rdi
.LEHB5:
	call	_Unwind_Resume@PLT
.LEHE5:
.L42:
	call	__stack_chk_fail@PLT
.L37:
	addq	$56, %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	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3774:
	.section	.gcc_except_table
.LLSDA3774:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3774-.LLSDACSB3774
.LLSDACSB3774:
	.uleb128 .LEHB3-.LFB3774
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB3774
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L38-.LFB3774
	.uleb128 0
	.uleb128 .LEHB5-.LFB3774
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
.LLSDACSE3774:
	.text
	.size	_ZN8CSV_Data11AddHostDataEfPvm, .-_ZN8CSV_Data11AddHostDataEfPvm
	.section	.rodata.str1.1
.LC9:
	.string	"device"
	.text
	.align 2
	.globl	_ZN8CSV_Data13AddDeviceDataEiifPvm
	.type	_ZN8CSV_Data13AddDeviceDataEiifPvm, @function
_ZN8CSV_Data13AddDeviceDataEiifPvm:
.LFB3775:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3775
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	%edx, %r13d
	movq	%r8, %rdx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%esi, %r12d
	movq	%rcx, %rsi
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movss	%xmm0, 12(%rsp)
	leaq	24(%rsp), %rbx
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
.LEHB6:
	call	_ZN8CSV_Data17CompareDeviceDataEPvm
	leaq	23(%rsp), %rdx
	leaq	.LC9(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE6:
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movq	%rbx, %rsi
	movss	12(%rsp), %xmm0
	movq	%rbp, %rdi
.LEHB7:
	call	_ZN8CSV_Data7AddDataENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiif
.LEHE7:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L47
	jmp	.L49
.L48:
	endbr64
	movq	%rax, %rbp
.L45:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	movq	%rbp, %rdi
.LEHB8:
	call	_Unwind_Resume@PLT
.LEHE8:
.L49:
	call	__stack_chk_fail@PLT
.L47:
	addq	$72, %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
.LFE3775:
	.section	.gcc_except_table
.LLSDA3775:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3775-.LLSDACSB3775
.LLSDACSB3775:
	.uleb128 .LEHB6-.LFB3775
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB7-.LFB3775
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L48-.LFB3775
	.uleb128 0
	.uleb128 .LEHB8-.LFB3775
	.uleb128 .LEHE8-.LEHB8
	.uleb128 0
	.uleb128 0
.LLSDACSE3775:
	.text
	.size	_ZN8CSV_Data13AddDeviceDataEiifPvm, .-_ZN8CSV_Data13AddDeviceDataEiifPvm
	.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
	.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:

#ifndef CSV_DATA_H
#define CSV_DATA_H

#include <string>
#include <fstream>
#include <iostream>

using namespace std;

class CSV_Data {
private:
    ofstream resultFile;
    bool printInfo;
    float host_exec_time;
    void *host_result = NULL;
    size_t host_result_size;
    void AddData(string Target, int numThreads, int numThreadBlks, float ExecTime);
    bool CompareDeviceData(void *device_result, size_t device_result_size);
public:
    CSV_Data(string fileName, bool printInfo=true);
    ~CSV_Data();
    void AddHostData(float ExecTime, void *host_result, size_t host_result_size);
    void AddDeviceData(int numThreads, int numThreadBlks, float ExecTime, void *device_result, size_t device_result_size);
};

#endif

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

                                        # End of file scope inline assembly
	.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
