#include "matrix.cuh"

#define PRINT_MAX 10
#define TRUNC(A) ((A) < PRINT_MAX ? (A) : PRINT_MAX)

void Matrix::print(int sz) const // prints the entire matrix
{
    if (sz)
    {

    }
    else
    {
        // print everything
        if (gpu_enabled)
        {
            float* a = new float[dim1*dim2];
            cudaMemcpy(a, matrix, sizeof(float)*dim1*dim2, cudaMemcpyDeviceToHost);
            for (int i = 0; i < dim1; ++i)
            {
                for (int j = 0; j < dim2; ++j)
                    std::cout << a[INDEX(i,j,dim1,dim2)] << ",";

                std::cout << "\n";
            }
            delete[] a;
        }
        else
        {
            for (int i = 0; i < dim1; ++i)
            {
                for (int j = 0; j < dim2; ++j)
                    std::cout << matrix[INDEX(i,j,dim1,dim2)] << ",";

                std::cout << "\n";
            }
        }
    }
}
std::ostream& operator<<(std::ostream& os, const Matrix& mat) // sets the cout to the default print size
{
    os << "MATRIX " << (mat.is_gpu() ? "(GPU): (" : "(CPU): (");
    os << mat.get_dim1() << " x " << mat.get_dim2() << ")\n";

    int d1 = mat.get_dim1(), d2 = mat.get_dim2();

    if (mat.is_gpu()) // gpu version
    {
        // copy every line of the matrix
        if (mat.get_dim1() * mat.get_dim2() < 4096) // if there are less than 1024 elements, then just copy the cpu version
        {
            float *a = new float[d1*d2];
            cudaMemcpy(a, mat.get_matrix(), sizeof(float)*d1*d2, cudaMemcpyDeviceToHost);

            if (d2 == 1)
            {
                os << "[";
                for (int i = 0; i < TRUNC(d1); ++i)
                    os << a[i] << ",";
                os << "...]\n";
            }
            else
            {
                for (int i = 0; i < TRUNC(d1); ++i)
                {
                    for (int j = 0; j < TRUNC(d2); ++j)
                        os << a[INDEX(i,j,d1,d2)] << ",";
                    os << "...\n";
                }
                os << "......\n";
            }
            delete[] a;
        }
        else
        {
            // matrix is too big. too slow to copy the entire thing. we just copy the 100 numbers we want
            float a[PRINT_MAX];

            if (d2 == 1)
            {
                cudaMemcpy(a, mat.get_matrix(), sizeof(float)*PRINT_MAX, cudaMemcpyDeviceToHost);
                os << "[";
                for (int i = 0; i < TRUNC(d1); ++i)
                    os << a[i] << ",";
                os << "...]\n";
            }
            else
            {
                for (int i = 0; i < TRUNC(d1); ++i)
                {
                    // copy the memory of only one of the lines (of 10 things)
                    cudaMemcpy(a, mat.get_matrix() + INDEX(i,0,d1,d2), sizeof(float)*PRINT_MAX, cudaMemcpyDeviceToHost);
                    // print the stuff
                    for (int j = 0; j < TRUNC(d2); ++j)
                        os << a[j] << ",";

                    os << "...\n";
                }
                os << "......\n";
            }
        }
    }
    else // cpu version
    {
        float *a = mat.get_matrix();

        if (d2 == 1) // if it's just a column matrix, we can save some space on the terminal by putting it as a row. We will use square brackets to denote this
        {
            os << "[";
            for (int i = 0; i < TRUNC(d1); ++i)
                os << a[i] << ",";
            os << "...]\n";
        }
        else
        {
            for (int i = 0; i < TRUNC(d1); ++i)
            {
                for (int j = 0; j < TRUNC(d2); ++j)
				{
					os << a[INDEX(i, j, d1, d2)] << ",";
				}
                os << "...\n";
            }
            os << "......\n";
        }
    }
    return os;
}

	.file	"tmpxft_00242c2d_00000000-6_matrix_io.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3646:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3646:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	","
.LC1:
	.string	"\n"
	.text
	.align 2
	.globl	_ZNK6Matrix5printEi
	.type	_ZNK6Matrix5printEi, @function
_ZNK6Matrix5printEi:
.LFB3642:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jne	.L17
	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
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	cmpb	$0, 16(%rbx)
	je	.L13
	movabsq	$2305843009213693950, %rax
	imull	4(%rbx), %edi
	movslq	%edi, %rdi
	cmpq	%rdi, %rax
	jb	.L6
	salq	$2, %rdi
	xorl	%r13d, %r13d
	leaq	_ZSt4cout(%rip), %r12
	call	_Znam@PLT
	movslq	(%rbx), %rdx
	movq	8(%rbx), %rsi
	movl	$2, %ecx
	movq	%rax, %rbp
	movslq	4(%rbx), %rax
	movq	%rbp, %rdi
	imulq	%rax, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	jmp	.L7
.L6:
	call	__cxa_throw_bad_array_new_length@PLT
.L22:
	leaq	.LC1(%rip), %rsi
	movq	%r12, %rdi
	incl	%r13d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L7:
	cmpl	%r13d, (%rbx)
	jle	.L21
	xorl	%r14d, %r14d
.L9:
	movl	4(%rbx), %eax
	cmpl	%r14d, %eax
	jle	.L22
	imull	%r13d, %eax
	movq	%r12, %rdi
	addl	%r14d, %eax
	incl	%r14d
	cltq
	cvtss2sd	0(%rbp,%rax,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L9
.L21:
	popq	%rbx
	.cfi_remember_state
	.cfi_restore 3
	.cfi_def_cfa_offset 40
	movq	%rbp, %rdi
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_restore 12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_restore 13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_restore 14
	.cfi_def_cfa_offset 8
	jmp	_ZdaPv@PLT
.L13:
	.cfi_restore_state
	xorl	%r12d, %r12d
	leaq	_ZSt4cout(%rip), %rbp
.L5:
	cmpl	%r12d, (%rbx)
	jle	.L23
	xorl	%r13d, %r13d
.L11:
	movl	4(%rbx), %eax
	cmpl	%r13d, %eax
	jle	.L24
	imull	%r12d, %eax
	movq	8(%rbx), %rdx
	movq	%rbp, %rdi
	addl	%r13d, %eax
	incl	%r13d
	cltq
	cvtss2sd	(%rdx,%rax,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L11
.L24:
	leaq	.LC1(%rip), %rsi
	movq	%rbp, %rdi
	incl	%r12d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L5
.L23:
	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
.L17:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	ret
	.cfi_endproc
.LFE3642:
	.size	_ZNK6Matrix5printEi, .-_ZNK6Matrix5printEi
	.section	.rodata.str1.1
.LC2:
	.string	"(GPU): ("
.LC3:
	.string	"(CPU): ("
.LC4:
	.string	"MATRIX "
.LC5:
	.string	" x "
.LC6:
	.string	")\n"
.LC7:
	.string	"["
.LC8:
	.string	"...]\n"
.LC9:
	.string	"...\n"
.LC10:
	.string	"......\n"
	.text
	.globl	_ZlsRSoRK6Matrix
	.type	_ZlsRSoRK6Matrix, @function
_ZlsRSoRK6Matrix:
.LFB3643:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	leaq	.LC4(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpb	$0, 16(%r12)
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	leaq	.LC2(%rip), %rax
	cmovne	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%r12), %esi
	movq	8(%rsp), %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	4(%r12), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC6(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpb	$0, 16(%r12)
	movl	(%r12), %ebp
	movl	4(%r12), %ebx
	je	.L27
	movl	%ebx, %edi
	imull	%ebp, %edi
	cmpl	$4095, %edi
	jg	.L28
	movabsq	$2305843009213693950, %rax
	movslq	%edi, %rdi
	cmpq	%rdi, %rax
	jb	.L29
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	%ebp, %rdx
	movq	8(%r12), %rsi
	movl	$2, %ecx
	movq	%rax, %r13
	movslq	%ebx, %rax
	imulq	%rax, %rdx
	movq	%r13, %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	cmpl	$1, %ebx
	je	.L30
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	jmp	.L31
.L29:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L60
	call	__cxa_throw_bad_array_new_length@PLT
.L30:
	movq	8(%rsp), %rdi
	leaq	.LC7(%rip), %rsi
	xorl	%ebx, %ebx
	leaq	.LC0(%rip), %r12
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L33:
	movl	$10, %eax
	cmpl	%eax, %ebp
	cmovle	%ebp, %eax
	cmpl	%ebx, %eax
	jle	.L62
	movq	8(%rsp), %rdi
	cvtss2sd	0(%r13,%rbx,4), %xmm0
	incq	%rbx
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L33
.L62:
	leaq	.LC8(%rip), %rsi
	jmp	.L58
.L63:
	movq	8(%rsp), %rdi
	leaq	.LC9(%rip), %rsi
	incl	%r14d
	addl	%ebx, %r12d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L31:
	movl	$10, %eax
	cmpl	%eax, %ebp
	cmovle	%ebp, %eax
	cmpl	%r14d, %eax
	jle	.L37
	movslq	%r12d, %rax
	xorl	%r15d, %r15d
	leaq	0(%r13,%rax,4), %rcx
.L38:
	movl	$10, %eax
	cmpl	%eax, %ebx
	cmovle	%ebx, %eax
	cmpl	%r15d, %eax
	jle	.L63
	movq	8(%rsp), %rdi
	cvtss2sd	(%rcx,%r15,4), %xmm0
	movq	%rcx, 16(%rsp)
	incq	%r15
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	16(%rsp), %rcx
	jmp	.L38
.L37:
	leaq	.LC10(%rip), %rsi
.L58:
	movq	8(%rsp), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r13, %rdi
	call	_ZdaPv@PLT
	jmp	.L39
.L28:
	cmpl	$1, %ebx
	je	.L40
	movslq	%ebx, %rax
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	salq	$2, %rax
	movq	%rax, 16(%rsp)
	jmp	.L41
.L40:
	movq	8(%r12), %rsi
	leaq	32(%rsp), %r12
	movl	$2, %ecx
	xorl	%ebx, %ebx
	movl	$40, %edx
	movq	%r12, %rdi
	leaq	.LC0(%rip), %r13
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L42:
	movl	$10, %eax
	cmpl	%eax, %ebp
	cmovle	%ebp, %eax
	cmpl	%ebx, %eax
	jle	.L61
	movq	8(%rsp), %rdi
	cvtss2sd	(%r12,%rbx,4), %xmm0
	incq	%rbx
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L42
.L64:
	movq	8(%rsp), %rdi
	leaq	.LC9(%rip), %rsi
	incl	%r13d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	16(%rsp), %rax
	addq	%rax, %r14
.L41:
	movl	$10, %eax
	cmpl	%eax, %ebp
	cmovle	%ebp, %eax
	cmpl	%r13d, %eax
	jle	.L53
	movq	8(%r12), %rsi
	leaq	32(%rsp), %r15
	movl	$40, %edx
	movl	$2, %ecx
	movq	%r15, %rdi
	addq	%r14, %rsi
	call	cudaMemcpy@PLT
	xorl	%edx, %edx
.L45:
	movl	$10, %eax
	cmpl	%eax, %ebx
	cmovle	%ebx, %eax
	cmpl	%edx, %eax
	jle	.L64
	movq	8(%rsp), %rdi
	movq	%rdx, 24(%rsp)
	cvtss2sd	(%r15,%rdx,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	24(%rsp), %rdx
	incq	%rdx
	jmp	.L45
.L27:
	movq	8(%r12), %r14
	cmpl	$1, %ebx
	je	.L48
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	jmp	.L49
.L48:
	movq	8(%rsp), %rdi
	leaq	.LC7(%rip), %rsi
	xorl	%ebx, %ebx
	leaq	.LC0(%rip), %r12
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L50:
	movl	$10, %eax
	cmpl	%eax, %ebp
	cmovle	%ebp, %eax
	cmpl	%ebx, %eax
	jle	.L61
	movq	8(%rsp), %rdi
	cvtss2sd	(%r14,%rbx,4), %xmm0
	incq	%rbx
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L50
.L61:
	leaq	.LC8(%rip), %rsi
	jmp	.L59
.L65:
	movq	8(%rsp), %rdi
	leaq	.LC9(%rip), %rsi
	incl	%r13d
	addl	%ebx, %r12d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L49:
	movl	$10, %eax
	cmpl	%eax, %ebp
	cmovle	%ebp, %eax
	cmpl	%r13d, %eax
	jle	.L53
	movslq	%r12d, %rax
	xorl	%r15d, %r15d
	leaq	(%r14,%rax,4), %rcx
.L54:
	movl	$10, %eax
	cmpl	%eax, %ebx
	cmovle	%ebx, %eax
	cmpl	%r15d, %eax
	jle	.L65
	movq	8(%rsp), %rdi
	cvtss2sd	(%rcx,%r15,4), %xmm0
	movq	%rcx, 16(%rsp)
	incq	%r15
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	16(%rsp), %rcx
	jmp	.L54
.L53:
	leaq	.LC10(%rip), %rsi
.L59:
	movq	8(%rsp), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L39:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L55
.L60:
	call	__stack_chk_fail@PLT
.L55:
	movq	8(%rsp), %rax
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3643:
	.size	_ZlsRSoRK6Matrix, .-_ZlsRSoRK6Matrix
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3669:
	.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
.LFE3669:
	.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:


#include <hip/hip_runtime.h>
#include "matrix.cuh"

#define PRINT_MAX 10
#define TRUNC(A) ((A) < PRINT_MAX ? (A) : PRINT_MAX)

void Matrix::print(int sz) const // prints the entire matrix
{
    if (sz)
    {

    }
    else
    {
        // print everything
        if (gpu_enabled)
        {
            float* a = new float[dim1*dim2];
            hipMemcpy(a, matrix, sizeof(float)*dim1*dim2, hipMemcpyDeviceToHost);
            for (int i = 0; i < dim1; ++i)
            {
                for (int j = 0; j < dim2; ++j)
                    std::cout << a[INDEX(i,j,dim1,dim2)] << ",";

                std::cout << "\n";
            }
            delete[] a;
        }
        else
        {
            for (int i = 0; i < dim1; ++i)
            {
                for (int j = 0; j < dim2; ++j)
                    std::cout << matrix[INDEX(i,j,dim1,dim2)] << ",";

                std::cout << "\n";
            }
        }
    }
}
std::ostream& operator<<(std::ostream& os, const Matrix& mat) // sets the cout to the default print size
{
    os << "MATRIX " << (mat.is_gpu() ? "(GPU): (" : "(CPU): (");
    os << mat.get_dim1() << " x " << mat.get_dim2() << ")\n";

    int d1 = mat.get_dim1(), d2 = mat.get_dim2();

    if (mat.is_gpu()) // gpu version
    {
        // copy every line of the matrix
        if (mat.get_dim1() * mat.get_dim2() < 4096) // if there are less than 1024 elements, then just copy the cpu version
        {
            float *a = new float[d1*d2];
            hipMemcpy(a, mat.get_matrix(), sizeof(float)*d1*d2, hipMemcpyDeviceToHost);

            if (d2 == 1)
            {
                os << "[";
                for (int i = 0; i < TRUNC(d1); ++i)
                    os << a[i] << ",";
                os << "...]\n";
            }
            else
            {
                for (int i = 0; i < TRUNC(d1); ++i)
                {
                    for (int j = 0; j < TRUNC(d2); ++j)
                        os << a[INDEX(i,j,d1,d2)] << ",";
                    os << "...\n";
                }
                os << "......\n";
            }
            delete[] a;
        }
        else
        {
            // matrix is too big. too slow to copy the entire thing. we just copy the 100 numbers we want
            float a[PRINT_MAX];

            if (d2 == 1)
            {
                hipMemcpy(a, mat.get_matrix(), sizeof(float)*PRINT_MAX, hipMemcpyDeviceToHost);
                os << "[";
                for (int i = 0; i < TRUNC(d1); ++i)
                    os << a[i] << ",";
                os << "...]\n";
            }
            else
            {
                for (int i = 0; i < TRUNC(d1); ++i)
                {
                    // copy the memory of only one of the lines (of 10 things)
                    hipMemcpy(a, mat.get_matrix() + INDEX(i,0,d1,d2), sizeof(float)*PRINT_MAX, hipMemcpyDeviceToHost);
                    // print the stuff
                    for (int j = 0; j < TRUNC(d2); ++j)
                        os << a[j] << ",";

                    os << "...\n";
                }
                os << "......\n";
            }
        }
    }
    else // cpu version
    {
        float *a = mat.get_matrix();

        if (d2 == 1) // if it's just a column matrix, we can save some space on the terminal by putting it as a row. We will use square brackets to denote this
        {
            os << "[";
            for (int i = 0; i < TRUNC(d1); ++i)
                os << a[i] << ",";
            os << "...]\n";
        }
        else
        {
            for (int i = 0; i < TRUNC(d1); ++i)
            {
                for (int j = 0; j < TRUNC(d2); ++j)
				{
					os << a[INDEX(i, j, d1, d2)] << ",";
				}
                os << "...\n";
            }
            os << "......\n";
        }
    }
    return os;
}

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

                                        # End of file scope inline assembly
	.globl	_ZNK6Matrix5printEi             # -- Begin function _ZNK6Matrix5printEi
	.p2align	1, 0x90
	.type	_ZNK6Matrix5printEi,@function
_ZNK6Matrix5printEi:                    # @_ZNK6Matrix5printEi
	.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
	testl	%esi, %esi
	je	.LBB0_1
.LBB0_8:                                # %.loopexit
	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
.LBB0_1:
	.cfi_def_cfa_offset 48
	movq	%rdi, %rbx
	cmpb	$0, 16(%rdi)
	movslq	(%rdi), %rax
	je	.LBB0_2
# %bb.9:
	movslq	4(%rbx), %rcx
	imulq	%rax, %rcx
	movq	%rcx, %r15
	shlq	$2, %r15
	testl	%ecx, %ecx
	movq	$-1, %rdi
	cmovnsq	%r15, %rdi
	callq	_Znam
	movq	%rax, %r14
	movq	8(%rbx), %rsi
	movq	%rax, %rdi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	cmpl	$0, (%rbx)
	jle	.LBB0_15
# %bb.10:                               # %.preheader23.preheader
	xorl	%r15d, %r15d
.LBB0_11:                               # %.preheader23
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_13 Depth 2
	movl	4(%rbx), %eax
	testl	%eax, %eax
	jle	.LBB0_14
# %bb.12:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB0_11 Depth=1
	xorl	%r12d, %r12d
.LBB0_13:                               # %.lr.ph
                                        #   Parent Loop BB0_11 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	imull	%r15d, %eax
	cltq
	addq	%r12, %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%rax,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	4(%rbx), %eax
	incq	%r12
	cmpl	%eax, %r12d
	jl	.LBB0_13
.LBB0_14:                               # %._crit_edge
                                        #   in Loop: Header=BB0_11 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incl	%r15d
	cmpl	(%rbx), %r15d
	jl	.LBB0_11
.LBB0_15:                               # %._crit_edge26
	movq	%r14, %rdi
	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
	jmp	_ZdaPv                          # TAILCALL
.LBB0_2:                                # %.preheader22
	.cfi_def_cfa_offset 48
	testl	%eax, %eax
	jle	.LBB0_8
# %bb.3:                                # %.preheader.lr.ph
	xorl	%r14d, %r14d
.LBB0_4:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_6 Depth 2
	movl	4(%rbx), %eax
	testl	%eax, %eax
	jle	.LBB0_7
# %bb.5:                                # %.lr.ph28.preheader
                                        #   in Loop: Header=BB0_4 Depth=1
	xorl	%r15d, %r15d
.LBB0_6:                                # %.lr.ph28
                                        #   Parent Loop BB0_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	8(%rbx), %rcx
	imull	%r14d, %eax
	cltq
	addq	%r15, %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rcx,%rax,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	4(%rbx), %eax
	incq	%r15
	cmpl	%eax, %r15d
	jl	.LBB0_6
.LBB0_7:                                # %._crit_edge29
                                        #   in Loop: Header=BB0_4 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incl	%r14d
	cmpl	(%rbx), %r14d
	jl	.LBB0_4
	jmp	.LBB0_8
.Lfunc_end0:
	.size	_ZNK6Matrix5printEi, .Lfunc_end0-_ZNK6Matrix5printEi
	.cfi_endproc
                                        # -- End function
	.globl	_ZlsRSoRK6Matrix                # -- Begin function _ZlsRSoRK6Matrix
	.type	_ZlsRSoRK6Matrix,@function
_ZlsRSoRK6Matrix:                       # @_ZlsRSoRK6Matrix
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	$.L.str.2, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cmpb	$0, 16(%r14)
	movl	$.L.str.4, %eax
	movl	$.L.str.3, %esi
	cmoveq	%rax, %rsi
	movl	$8, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movl	$.L.str.5, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	4(%r14), %esi
	movq	%r15, %rdi
	callq	_ZNSolsEi
	movl	$.L.str.6, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movslq	(%r14), %r13
	movslq	4(%r14), %rcx
	cmpb	$0, 16(%r14)
	movq	%rcx, 8(%rsp)                   # 8-byte Spill
	je	.LBB1_29
# %bb.1:
	movl	%r13d, %eax
	imull	%ecx, %eax
	cmpl	$4095, %eax                     # imm = 0xFFF
	jg	.LBB1_16
# %bb.2:
	movslq	%eax, %rcx
	shlq	$2, %rcx
	testl	%eax, %eax
	movq	$-1, %rdi
	cmovnsq	%rcx, %rdi
	callq	_Znam
	movq	%rax, %r12
	movq	8(%r14), %rsi
	movq	%r13, %rdx
	imulq	8(%rsp), %rdx                   # 8-byte Folded Reload
	shlq	$2, %rdx
	movq	%rax, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rax                   # 8-byte Reload
	cmpl	$1, %eax
	jne	.LBB1_3
# %bb.10:
	movl	$.L.str.7, %esi
	movl	$1, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	testl	%r13d, %r13d
	jle	.LBB1_13
# %bb.11:                               # %.lr.ph122.preheader
	cmpl	$10, %r13d
	movl	$10, %r14d
	cmovll	%r13d, %r14d
	xorl	%r15d, %r15d
.LBB1_12:                               # %.lr.ph122
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r12,%r15,4), %xmm0
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB1_12
.LBB1_13:                               # %._crit_edge123
	movl	$.L.str.8, %esi
	movl	$5, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB1_14
.LBB1_29:
	movq	8(%r14), %r14
	cmpl	$1, %ecx
	jne	.LBB1_30
# %bb.36:
	movl	$.L.str.7, %esi
	movl	$1, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	testl	%r13d, %r13d
	jle	.LBB1_27
# %bb.37:                               # %.lr.ph131.preheader
	cmpl	$10, %r13d
	movl	$10, %r15d
	cmovll	%r13d, %r15d
	xorl	%r12d, %r12d
.LBB1_38:                               # %.lr.ph131
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%r12,4), %xmm0
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r12
	cmpq	%r12, %r15
	jne	.LBB1_38
	jmp	.LBB1_27
.LBB1_16:
	cmpl	$1, %ecx
	jne	.LBB1_17
# %bb.24:
	movq	8(%r14), %rsi
	leaq	32(%rsp), %rdi
	movl	$40, %edx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$.L.str.7, %esi
	movl	$1, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	testl	%r13d, %r13d
	jle	.LBB1_27
# %bb.25:                               # %.lr.ph113.preheader
	cmpl	$10, %r13d
	movl	$10, %r14d
	cmovll	%r13d, %r14d
	xorl	%r15d, %r15d
.LBB1_26:                               # %.lr.ph113
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	32(%rsp,%r15,4), %xmm0
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB1_26
.LBB1_27:                               # %._crit_edge114
	movl	$.L.str.8, %esi
	movl	$5, %edx
	jmp	.LBB1_28
.LBB1_30:                               # %.preheader103
	movq	%r14, 16(%rsp)                  # 8-byte Spill
	testl	%r13d, %r13d
	jle	.LBB1_23
# %bb.31:                               # %.preheader.lr.ph
	movl	$10, %r15d
	cmpl	%r15d, %r13d
	cmovgel	%r15d, %r13d
	cmpl	%r15d, %ecx
	cmovll	%ecx, %r15d
	xorl	%ebp, %ebp
	xorl	%r12d, %r12d
	movq	%r13, 24(%rsp)                  # 8-byte Spill
.LBB1_32:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_34 Depth 2
	testl	%ecx, %ecx
	jle	.LBB1_35
# %bb.33:                               # %.lr.ph125
                                        #   in Loop: Header=BB1_32 Depth=1
	movl	%ebp, %eax
	movq	16(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r13d, %r13d
.LBB1_34:                               #   Parent Loop BB1_32 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%r13,4), %xmm0
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r13
	cmpq	%r13, %r15
	jne	.LBB1_34
.LBB1_35:                               # %._crit_edge126
                                        #   in Loop: Header=BB1_32 Depth=1
	movl	$.L.str.9, %esi
	movl	$4, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r12
	movq	8(%rsp), %rcx                   # 8-byte Reload
	addl	%ecx, %ebp
	movq	24(%rsp), %r13                  # 8-byte Reload
	cmpq	%r13, %r12
	jne	.LBB1_32
	jmp	.LBB1_23
.LBB1_3:                                # %.preheader105
	movq	%r12, 16(%rsp)                  # 8-byte Spill
	testl	%r13d, %r13d
	jle	.LBB1_9
# %bb.4:                                # %.preheader104.lr.ph
	movl	$10, %r14d
	cmpl	%r14d, %r13d
	cmovgel	%r14d, %r13d
	cmpl	%r14d, %eax
	cmovll	%eax, %r14d
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	movq	%r13, 24(%rsp)                  # 8-byte Spill
.LBB1_5:                                # %.preheader104
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_7 Depth 2
	testl	%eax, %eax
	jle	.LBB1_8
# %bb.6:                                # %.lr.ph116
                                        #   in Loop: Header=BB1_5 Depth=1
	movl	%ebp, %eax
	movq	16(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %r12
	xorl	%r13d, %r13d
.LBB1_7:                                #   Parent Loop BB1_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r12,%r13,4), %xmm0
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r13
	cmpq	%r13, %r14
	jne	.LBB1_7
.LBB1_8:                                # %._crit_edge117
                                        #   in Loop: Header=BB1_5 Depth=1
	movl	$.L.str.9, %esi
	movl	$4, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r15
	movq	8(%rsp), %rax                   # 8-byte Reload
	addl	%eax, %ebp
	movq	24(%rsp), %r13                  # 8-byte Reload
	cmpq	%r13, %r15
	jne	.LBB1_5
.LBB1_9:                                # %._crit_edge119
	movl	$.L.str.10, %esi
	movl	$7, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	16(%rsp), %r12                  # 8-byte Reload
.LBB1_14:
	movq	%r12, %rdi
	callq	_ZdaPv
	jmp	.LBB1_15
.LBB1_17:                               # %.preheader106
	testl	%r13d, %r13d
	jle	.LBB1_23
# %bb.18:                               # %.lr.ph109
	movl	$10, %ebp
	cmpl	%ebp, %r13d
	cmovgel	%ebp, %r13d
	movq	8(%rsp), %rax                   # 8-byte Reload
	cmpl	%ebp, %eax
	cmovll	%eax, %ebp
	xorl	%r15d, %r15d
.LBB1_19:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_21 Depth 2
	movq	%r15, %rsi
	movq	8(%rsp), %r12                   # 8-byte Reload
	imulq	%r12, %rsi
	shlq	$2, %rsi
	addq	8(%r14), %rsi
	movl	$40, %edx
	leaq	32(%rsp), %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r12d, %r12d
	jle	.LBB1_22
# %bb.20:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB1_19 Depth=1
	xorl	%r12d, %r12d
.LBB1_21:                               # %.lr.ph
                                        #   Parent Loop BB1_19 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	32(%rsp,%r12,4), %xmm0
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r12
	cmpq	%r12, %rbp
	jne	.LBB1_21
.LBB1_22:                               # %._crit_edge
                                        #   in Loop: Header=BB1_19 Depth=1
	movl	$.L.str.9, %esi
	movl	$4, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r15
	cmpq	%r13, %r15
	jne	.LBB1_19
.LBB1_23:                               # %._crit_edge110
	movl	$.L.str.10, %esi
	movl	$7, %edx
.LBB1_28:
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB1_15:
	movq	%rbx, %rax
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_ZlsRSoRK6Matrix, .Lfunc_end1-_ZlsRSoRK6Matrix
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	","
	.size	.L.str, 2

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"\n"
	.size	.L.str.1, 2

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

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"(GPU): ("
	.size	.L.str.3, 9

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"(CPU): ("
	.size	.L.str.4, 9

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	" x "
	.size	.L.str.5, 4

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	")\n"
	.size	.L.str.6, 3

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

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"...]\n"
	.size	.L.str.8, 6

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"...\n"
	.size	.L.str.9, 5

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"......\n"
	.size	.L.str.10, 8

	.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 _ZSt4cout
	.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
