#include <fstream>
#include <iostream>
#include <cuda_runtime.h>
// C++ Program for Floyd Warshall Algorithm  
//#include <bits/stdc++.h> 
#include <chrono>
#include <ctime>  
using namespace std; 
  
/* Define Infinite as a large enough 
value.This value will be used for  
vertices not connected to each other */
#define INF 99999  

void floydWarshall (int** graph, int** dist, int nNodes)  
{  

  
    /* Add all vertices one by one to  
    the set of intermediate vertices.  
    ---> Before start of an iteration,  
    we have shortest distances between all  
    pairs of vertices such that the  
    shortest distances consider only the  
    vertices in set {0, 1, 2, .. k-1} as 
    intermediate vertices.  
    ----> After the end of an iteration,  
    vertex no. k is added to the set of  
    intermediate vertices and the set becomes {0, 1, 2, .. k} */
    for (int k = 0; k < nNodes; k++)  
    {  
        // Pick all vertices as source one by one  
        for (int i = 0; i < nNodes; i++)  
        {  
            // Pick all vertices as destination for the  
            // above picked source  
            for (int j = 0; j < nNodes; j++)  
            {  
                // If vertex k is on the shortest path from  
                // i to j, then update the value of dist[i][j]  
                if (dist[i][k] + dist[k][j] < dist[i][j])  
                    dist[i][j] = dist[i][k] + dist[k][j];  
            }  
        }  
    }  
	
  
}  
  
// Solves the all-pairs shortest path  
// problem using Floyd Warshall algorithm  
__global__ void vecFloydWarshall(int** graph, int* dist, int nNodes, int k)
{
	/* Add all vertices one by one to
	the set of intermediate vertices.
	---> Before start of an iteration,
	we have shortest distances between all
	pairs of vertices such that the
	shortest distances consider only the
	vertices in set {0, 1, 2, .. k-1} as
	intermediate vertices.
	----> After the end of an iteration,
	vertex no. k is added to the set of
	intermediate vertices and the set becomes {0, 1, 2, .. k} */
	// Pick all vertices as source one by one  
	for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < nNodes; i += blockDim.x * gridDim.x)
	{
		for (int j = blockIdx.y * blockDim.y + threadIdx.y; j < nNodes; j += blockDim.y * gridDim.y)
		{
			// Pick all vertices as destination for the  
			// above picked source  
			// If vertex k is on the shortest path from  
			// i to j, then update the value of dist[i][j]  
			//printf("j: %d\n",j);
			if (dist[i*nNodes+k] + dist[k*nNodes+j] < dist[i*nNodes+j]){
				dist[i*nNodes+j] = dist[i*nNodes+k] + dist[k*nNodes+j];
				//printf("i %d, j %d\n",i,j);
			}
		}
	}
}

/* A utility function to print solution */
void printSolution(int** dist, int nNodes)
{
	for (int i = 0; i < nNodes; i++)
	{
		for (int j = 0; j < nNodes; j++)
		{
			if (dist[i][j] == INF)
				cout << "INF" << "     ";
			else
				cout << dist[i][j] << "     ";
		}
		cout << endl;
	}
}

// This code is contributed by rathbhupendra 

int main(int argc, char **argv){
	int** graph;
	int** dist;
	int a, b, w, nNodes;
	int* device_dist;
	int* aux_dist;

	if (argc > 1) 
	{
		//cout << "input file is " << argv[1] << endl;
		ifstream inputfile(argv[1]);
		inputfile >> nNodes;
		graph = new int*[nNodes];
		for (int i = 0; i < nNodes; ++i)
		{
			graph[i] = new int[nNodes];
			for (int j = 0; j < nNodes; ++j)
				graph[i][j] = INF;	
		}
		while (inputfile >> a >> b >> w)	
		{
			graph[a][b] = w;
			graph[b][a] = w;
		}
	}
  
	dist = new int*[nNodes];
	aux_dist = new int[nNodes * nNodes];
	for (int i = 0; i < nNodes; ++i)
		dist[i] = new int[nNodes];
    /* dist[][] will be the output matrix  
    that will finally have the shortest  
    distances between every pair of vertices */
    int  i, j, k;  
  
    /* Initialize the solution matrix same  
    as input graph matrix. Or we can say  
    the initial values of shortest distances 
    are based on shortest paths considering  
    no intermediate vertex. */
    for (i = 0; i < nNodes; i++)  {
        for (j = 0; j < nNodes; j++) {
			dist[i][j] = graph[i][j];  
			aux_dist[i*nNodes+j] = graph[i][j];
		}
	}
	//cout << graph[0][1] << " vs " << aux_dist[1] << "at position (" << 0 << "," << 1 << ")\n";
	
	cudaMalloc(&device_dist, nNodes * nNodes * sizeof(int));
	cudaMemcpy(device_dist, aux_dist, nNodes * nNodes * sizeof(int),cudaMemcpyHostToDevice);

	int blockSize = 256;
	int numBlocks = (nNodes + blockSize - 1) / blockSize;
	auto start = std::chrono::system_clock::now();
	for (int k = 0; k < nNodes; ++k){
		vecFloydWarshall<<<numBlocks, blockSize>>>(graph, device_dist, nNodes, k);
		cudaDeviceSynchronize();	
		//cout << "currently in " << k << endl;
	}
	auto end = std::chrono::system_clock::now();
	auto timeElapsed = (end - start);
	cudaMemcpy(aux_dist, device_dist, nNodes * nNodes * sizeof(int),cudaMemcpyDeviceToHost);
	floydWarshall (graph, dist, nNodes);

	/*int count = 0;
    for (i = 0; i < nNodes; i++)  {
        for (j = 0; j < nNodes; j++) {
			if (dist[i][j] != aux_dist[i*nNodes+j]){
				count += 1;
				cout << "cpu: " << dist[i][j] << " vs gpu: " << aux_dist[i*nNodes+j] << endl;
			}
		}
	}
	cout << "Error count between CPU and GPU: " << count << endl;*/
	for (i = 0; i < nNodes; i++)  {
        for (j = 0; j < nNodes; j++) {
			dist[i][j] = aux_dist[i*nNodes+j];
		}
	}
	
	//cout << graph[0][1] << " vs " << aux_dist[1] << "at position (" << 0 << "," << 1 << ")\n";
    // Print the shortest distance matrix  
    //printSolution(dist, nNodes);  
	auto sec = std::chrono::duration_cast<std::chrono::seconds>(timeElapsed).count();
	cout << "Computation time: " << sec << "\n";


    return 0;  
}  
  

	.file	"tmpxft_003b64ed_00000000-6_floyd_gpu.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3875:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3875:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z13floydWarshallPPiS0_i
	.type	_Z13floydWarshallPPiS0_i, @function
_Z13floydWarshallPPiS0_i:
.LFB3865:
	.cfi_startproc
	endbr64
	xorl	%ecx, %ecx
	cmpl	%ecx, %edx
	jg	.L14
	ret
.L14:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
.L12:
	movq	(%rsi,%rcx,8), %r10
	leaq	0(,%rcx,4), %r11
	xorl	%edi, %edi
.L8:
	movq	(%rsi,%rdi,8), %r9
	xorl	%eax, %eax
	leaq	(%r9,%r11), %rbx
.L5:
	movl	(%r10,%rax,4), %r8d
	addl	(%rbx), %r8d
	cmpl	(%r9,%rax,4), %r8d
	jge	.L4
	movl	%r8d, (%r9,%rax,4)
.L4:
	incq	%rax
	cmpl	%eax, %edx
	jg	.L5
	incq	%rdi
	cmpl	%edi, %edx
	jg	.L8
	incq	%rcx
	cmpl	%ecx, %edx
	jg	.L12
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3865:
	.size	_Z13floydWarshallPPiS0_i, .-_Z13floydWarshallPPiS0_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"INF"
.LC1:
	.string	"     "
	.text
	.globl	_Z13printSolutionPPii
	.type	_Z13printSolutionPPii, @function
_Z13printSolutionPPii:
.LFB3866:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r15, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	pushq	%rdx
	.cfi_def_cfa_offset 64
.L17:
	cmpl	%ebx, %ebp
	jle	.L25
	xorl	%r12d, %r12d
.L20:
	movq	0(%r13,%rbx,8), %rax
	leaq	.LC1(%rip), %r14
	movl	(%rax,%r12,4), %esi
	cmpl	$99999, %esi
	jne	.L18
	leaq	.LC0(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L24
.L18:
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEi@PLT
.L24:
	movq	%rax, %rdi
	movq	%r14, %rsi
	incq	%r12
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	%r15, %r12
	jne	.L20
	leaq	_ZSt4cout(%rip), %rdi
	incq	%rbx
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	jmp	.L17
.L25:
	popq	%rax
	.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
.LFE3866:
	.size	_Z13printSolutionPPii, .-_Z13printSolutionPPii
	.globl	_Z41__device_stub__Z16vecFloydWarshallPPiS_iiPPiS_ii
	.type	_Z41__device_stub__Z16vecFloydWarshallPPiS_iiPPiS_ii, @function
_Z41__device_stub__Z16vecFloydWarshallPPiS_iiPPiS_ii:
.LFB3897:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16vecFloydWarshallPPiS_ii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L26:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3897:
	.size	_Z41__device_stub__Z16vecFloydWarshallPPiS_iiPPiS_ii, .-_Z41__device_stub__Z16vecFloydWarshallPPiS_iiPPiS_ii
	.globl	_Z16vecFloydWarshallPPiS_ii
	.type	_Z16vecFloydWarshallPPiS_ii, @function
_Z16vecFloydWarshallPPiS_ii:
.LFB3898:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z16vecFloydWarshallPPiS_iiPPiS_ii
	.cfi_endproc
.LFE3898:
	.size	_Z16vecFloydWarshallPPiS_ii, .-_Z16vecFloydWarshallPPiS_ii
	.section	.rodata.str1.1
.LC2:
	.string	"_Z16vecFloydWarshallPPiS_ii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3900:
	.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	.LC2(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z16vecFloydWarshallPPiS_ii(%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
.LFE3900:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC3:
	.string	"Computation time: "
.LC4:
	.string	"\n"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3867:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3867
	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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$600, %rsp
	.cfi_def_cfa_offset 656
	movq	%fs:40, %rax
	movq	%rax, 584(%rsp)
	xorl	%eax, %eax
	decl	%edi
	jle	.L34
	movq	8(%rsi), %rsi
	leaq	64(%rsp), %rbp
	movl	$8, %edx
	movq	%rbp, %rdi
.LEHB0:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE0:
	leaq	28(%rsp), %rsi
	movq	%rbp, %rdi
.LEHB1:
	call	_ZNSirsERi@PLT
	movabsq	$1152921504606846975, %rax
	movslq	28(%rsp), %rdi
	cmpq	%rdi, %rax
	jb	.L35
	salq	$3, %rdi
	call	_Znam@PLT
	movq	%rax, %rbx
	xorl	%r12d, %r12d
	jmp	.L36
.L35:
	movq	584(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	call	__cxa_throw_bad_array_new_length@PLT
.L65:
	incq	%r12
.L36:
	movslq	28(%rsp), %rdi
	cmpl	%r12d, %edi
	jle	.L64
	salq	$2, %rdi
	call	_Znam@PLT
	movq	%rax, (%rbx,%r12,8)
	movl	28(%rsp), %ecx
	xorl	%edx, %edx
.L38:
	cmpl	%edx, %ecx
	jle	.L65
	movl	$99999, (%rax,%rdx,4)
	incq	%rdx
	jmp	.L38
.L64:
	leaq	16(%rsp), %r12
.L41:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	_ZNSirsERi@PLT
	movq	%rax, %rdi
	leaq	20(%rsp), %rsi
	call	_ZNSirsERi@PLT
	movq	%rax, %rdi
	leaq	24(%rsp), %rsi
	call	_ZNSirsERi@PLT
.LEHE1:
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L66
	movslq	16(%rsp), %rdx
	movslq	20(%rsp), %rcx
	movl	24(%rsp), %eax
	movq	(%rbx,%rdx,8), %rdx
	movl	%eax, (%rdx,%rcx,4)
	movslq	20(%rsp), %rdx
	movslq	16(%rsp), %rcx
	movq	(%rbx,%rdx,8), %rdx
	movl	%eax, (%rdx,%rcx,4)
	jmp	.L41
.L66:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
.L34:
	movabsq	$1152921504606846975, %rax
	movslq	28(%rsp), %rdi
	cmpq	%rdi, %rax
	jb	.L43
	salq	$3, %rdi
	xorl	%r13d, %r13d
.LEHB2:
	call	_Znam@PLT
	movl	28(%rsp), %edi
	movq	%rax, %rbp
	imull	%edi, %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	_Znam@PLT
	movq	%rax, %r12
	jmp	.L44
.L43:
	movq	584(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	call	__cxa_throw_bad_array_new_length@PLT
.L44:
	movslq	28(%rsp), %rdi
	movq	%rdi, %rsi
	salq	$2, %rdi
	cmpl	%r13d, %esi
	jle	.L67
	call	_Znam@PLT
	movq	%rax, 0(%rbp,%r13,8)
	incq	%r13
	jmp	.L44
.L67:
	movq	%r12, %r13
	movq	%r12, %rcx
	xorl	%edx, %edx
.L47:
	cmpl	%edx, %esi
	jle	.L68
	movq	(%rbx,%rdx,8), %r10
	movq	0(%rbp,%rdx,8), %r9
	xorl	%eax, %eax
.L48:
	movl	(%r10,%rax,4), %r8d
	movl	%r8d, (%r9,%rax,4)
	movl	%r8d, (%rcx,%rax,4)
	incq	%rax
	cmpl	%eax, %esi
	jg	.L48
	incq	%rdx
	addq	%rdi, %rcx
	jmp	.L47
.L68:
	imull	%esi, %esi
	leaq	32(%rsp), %rdi
	xorl	%r14d, %r14d
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movl	28(%rsp), %edx
	movq	32(%rsp), %rdi
	movq	%r12, %rsi
	movl	$1, %ecx
	imull	%edx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	28(%rsp), %eax
	movl	$256, %ecx
	addl	$255, %eax
	cltd
	idivl	%ecx
	movl	%eax, 12(%rsp)
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	%rax, %r15
.L50:
	cmpl	%r14d, 28(%rsp)
	jle	.L69
	movl	12(%rsp), %eax
	movl	$16777217, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$8, %rdx
	movl	$1, %ecx
	movl	%eax, 40(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 44(%rsp)
	movq	40(%rsp), %rdi
	movl	48(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L51
	movl	28(%rsp), %edx
	movq	32(%rsp), %rsi
	movl	%r14d, %ecx
	movq	%rbx, %rdi
	call	_Z41__device_stub__Z16vecFloydWarshallPPiS_iiPPiS_ii
.L51:
	call	cudaDeviceSynchronize@PLT
	incl	%r14d
	jmp	.L50
.L69:
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	28(%rsp), %edx
	movq	32(%rsp), %rsi
	movq	%r12, %rdi
	subq	%r15, %rax
	movl	$2, %ecx
	imull	%edx, %edx
	movq	%rax, %r14
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	28(%rsp), %edx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	_Z13floydWarshallPPiS0_i
	movslq	28(%rsp), %r8
	movq	%r8, %rdx
	salq	$2, %r8
	leal	-1(%rdx), %eax
	leaq	4(,%rax,4), %r9
	xorl	%eax, %eax
.L53:
	cmpl	%eax, %edx
	jle	.L70
	movq	0(%rbp,%rax,8), %rdi
	movq	%r13, %rsi
	movq	%r9, %rcx
	incq	%rax
	rep movsb
	addq	%r8, %r13
	jmp	.L53
.L70:
	leaq	.LC3(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1000000000, %ecx
	movq	%rax, %rdi
	movq	%r14, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	584(%rsp), %rax
	subq	%fs:40, %rax
	je	.L57
	jmp	.L61
.L59:
	endbr64
	movq	%rax, %rbx
.L55:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	584(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	movq	%rbx, %rdi
	call	_Unwind_Resume@PLT
.LEHE2:
.L61:
	call	__stack_chk_fail@PLT
.L57:
	addq	$600, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.LFE3867:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3867:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3867-.LLSDACSB3867
.LLSDACSB3867:
	.uleb128 .LEHB0-.LFB3867
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3867
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L59-.LFB3867
	.uleb128 0
	.uleb128 .LEHB2-.LFB3867
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE3867:
	.section	.text.startup
	.size	main, .-main
	.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:

#include <fstream>
#include <iostream>
#include <hip/hip_runtime.h>
// C++ Program for Floyd Warshall Algorithm  
//#include <bits/stdc++.h> 
#include <chrono>
#include <ctime>  
using namespace std; 
  
/* Define Infinite as a large enough 
value.This value will be used for  
vertices not connected to each other */
#define INF 99999  

void floydWarshall (int** graph, int** dist, int nNodes)  
{  

  
    /* Add all vertices one by one to  
    the set of intermediate vertices.  
    ---> Before start of an iteration,  
    we have shortest distances between all  
    pairs of vertices such that the  
    shortest distances consider only the  
    vertices in set {0, 1, 2, .. k-1} as 
    intermediate vertices.  
    ----> After the end of an iteration,  
    vertex no. k is added to the set of  
    intermediate vertices and the set becomes {0, 1, 2, .. k} */
    for (int k = 0; k < nNodes; k++)  
    {  
        // Pick all vertices as source one by one  
        for (int i = 0; i < nNodes; i++)  
        {  
            // Pick all vertices as destination for the  
            // above picked source  
            for (int j = 0; j < nNodes; j++)  
            {  
                // If vertex k is on the shortest path from  
                // i to j, then update the value of dist[i][j]  
                if (dist[i][k] + dist[k][j] < dist[i][j])  
                    dist[i][j] = dist[i][k] + dist[k][j];  
            }  
        }  
    }  
	
  
}  
  
// Solves the all-pairs shortest path  
// problem using Floyd Warshall algorithm  
__global__ void vecFloydWarshall(int** graph, int* dist, int nNodes, int k)
{
	/* Add all vertices one by one to
	the set of intermediate vertices.
	---> Before start of an iteration,
	we have shortest distances between all
	pairs of vertices such that the
	shortest distances consider only the
	vertices in set {0, 1, 2, .. k-1} as
	intermediate vertices.
	----> After the end of an iteration,
	vertex no. k is added to the set of
	intermediate vertices and the set becomes {0, 1, 2, .. k} */
	// Pick all vertices as source one by one  
	for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < nNodes; i += blockDim.x * gridDim.x)
	{
		for (int j = blockIdx.y * blockDim.y + threadIdx.y; j < nNodes; j += blockDim.y * gridDim.y)
		{
			// Pick all vertices as destination for the  
			// above picked source  
			// If vertex k is on the shortest path from  
			// i to j, then update the value of dist[i][j]  
			//printf("j: %d\n",j);
			if (dist[i*nNodes+k] + dist[k*nNodes+j] < dist[i*nNodes+j]){
				dist[i*nNodes+j] = dist[i*nNodes+k] + dist[k*nNodes+j];
				//printf("i %d, j %d\n",i,j);
			}
		}
	}
}

/* A utility function to print solution */
void printSolution(int** dist, int nNodes)
{
	for (int i = 0; i < nNodes; i++)
	{
		for (int j = 0; j < nNodes; j++)
		{
			if (dist[i][j] == INF)
				cout << "INF" << "     ";
			else
				cout << dist[i][j] << "     ";
		}
		cout << endl;
	}
}

// This code is contributed by rathbhupendra 

int main(int argc, char **argv){
	int** graph;
	int** dist;
	int a, b, w, nNodes;
	int* device_dist;
	int* aux_dist;

	if (argc > 1) 
	{
		//cout << "input file is " << argv[1] << endl;
		ifstream inputfile(argv[1]);
		inputfile >> nNodes;
		graph = new int*[nNodes];
		for (int i = 0; i < nNodes; ++i)
		{
			graph[i] = new int[nNodes];
			for (int j = 0; j < nNodes; ++j)
				graph[i][j] = INF;	
		}
		while (inputfile >> a >> b >> w)	
		{
			graph[a][b] = w;
			graph[b][a] = w;
		}
	}
  
	dist = new int*[nNodes];
	aux_dist = new int[nNodes * nNodes];
	for (int i = 0; i < nNodes; ++i)
		dist[i] = new int[nNodes];
    /* dist[][] will be the output matrix  
    that will finally have the shortest  
    distances between every pair of vertices */
    int  i, j, k;  
  
    /* Initialize the solution matrix same  
    as input graph matrix. Or we can say  
    the initial values of shortest distances 
    are based on shortest paths considering  
    no intermediate vertex. */
    for (i = 0; i < nNodes; i++)  {
        for (j = 0; j < nNodes; j++) {
			dist[i][j] = graph[i][j];  
			aux_dist[i*nNodes+j] = graph[i][j];
		}
	}
	//cout << graph[0][1] << " vs " << aux_dist[1] << "at position (" << 0 << "," << 1 << ")\n";
	
	hipMalloc(&device_dist, nNodes * nNodes * sizeof(int));
	hipMemcpy(device_dist, aux_dist, nNodes * nNodes * sizeof(int),hipMemcpyHostToDevice);

	int blockSize = 256;
	int numBlocks = (nNodes + blockSize - 1) / blockSize;
	auto start = std::chrono::system_clock::now();
	for (int k = 0; k < nNodes; ++k){
		vecFloydWarshall<<<numBlocks, blockSize>>>(graph, device_dist, nNodes, k);
		hipDeviceSynchronize();	
		//cout << "currently in " << k << endl;
	}
	auto end = std::chrono::system_clock::now();
	auto timeElapsed = (end - start);
	hipMemcpy(aux_dist, device_dist, nNodes * nNodes * sizeof(int),hipMemcpyDeviceToHost);
	floydWarshall (graph, dist, nNodes);

	/*int count = 0;
    for (i = 0; i < nNodes; i++)  {
        for (j = 0; j < nNodes; j++) {
			if (dist[i][j] != aux_dist[i*nNodes+j]){
				count += 1;
				cout << "cpu: " << dist[i][j] << " vs gpu: " << aux_dist[i*nNodes+j] << endl;
			}
		}
	}
	cout << "Error count between CPU and GPU: " << count << endl;*/
	for (i = 0; i < nNodes; i++)  {
        for (j = 0; j < nNodes; j++) {
			dist[i][j] = aux_dist[i*nNodes+j];
		}
	}
	
	//cout << graph[0][1] << " vs " << aux_dist[1] << "at position (" << 0 << "," << 1 << ")\n";
    // Print the shortest distance matrix  
    //printSolution(dist, nNodes);  
	auto sec = std::chrono::duration_cast<std::chrono::seconds>(timeElapsed).count();
	cout << "Computation time: " << sec << "\n";


    return 0;  
}  
  

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

                                        # End of file scope inline assembly
	.globl	_Z13floydWarshallPPiS0_i        # -- Begin function _Z13floydWarshallPPiS0_i
	.type	_Z13floydWarshallPPiS0_i,@function
_Z13floydWarshallPPiS0_i:               # @_Z13floydWarshallPPiS0_i
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB0_9
# %bb.1:                                # %.preheader30.lr.ph
	movl	%edx, %eax
	xorl	%ecx, %ecx
.LBB0_2:                                # %.preheader.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_3 Depth 2
                                        #       Child Loop BB0_4 Depth 3
	movq	(%rsi,%rcx,8), %rdx
	xorl	%edi, %edi
.LBB0_3:                                # %.preheader
                                        #   Parent Loop BB0_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB0_4 Depth 3
	movq	(%rsi,%rdi,8), %r8
	xorl	%r9d, %r9d
.LBB0_4:                                #   Parent Loop BB0_2 Depth=1
                                        #     Parent Loop BB0_3 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rdx,%r9,4), %r10d
	addl	(%r8,%rcx,4), %r10d
	cmpl	(%r8,%r9,4), %r10d
	jge	.LBB0_6
# %bb.5:                                #   in Loop: Header=BB0_4 Depth=3
	movl	%r10d, (%r8,%r9,4)
.LBB0_6:                                #   in Loop: Header=BB0_4 Depth=3
	incq	%r9
	cmpq	%r9, %rax
	jne	.LBB0_4
# %bb.7:                                # %._crit_edge
                                        #   in Loop: Header=BB0_3 Depth=2
	incq	%rdi
	cmpq	%rax, %rdi
	jne	.LBB0_3
# %bb.8:                                # %._crit_edge33
                                        #   in Loop: Header=BB0_2 Depth=1
	incq	%rcx
	cmpq	%rax, %rcx
	jne	.LBB0_2
.LBB0_9:                                # %._crit_edge35
	retq
.Lfunc_end0:
	.size	_Z13floydWarshallPPiS0_i, .Lfunc_end0-_Z13floydWarshallPPiS0_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z31__device_stub__vecFloydWarshallPPiS_ii # -- Begin function _Z31__device_stub__vecFloydWarshallPPiS_ii
	.type	_Z31__device_stub__vecFloydWarshallPPiS_ii,@function
_Z31__device_stub__vecFloydWarshallPPiS_ii: # @_Z31__device_stub__vecFloydWarshallPPiS_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$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), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z16vecFloydWarshallPPiS_ii, %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	_Z31__device_stub__vecFloydWarshallPPiS_ii, .Lfunc_end1-_Z31__device_stub__vecFloydWarshallPPiS_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z13printSolutionPPii           # -- Begin function _Z13printSolutionPPii
	.type	_Z13printSolutionPPii,@function
_Z13printSolutionPPii:                  # @_Z13printSolutionPPii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB2_9
# %bb.1:                                # %.preheader.lr.ph
	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
	pushq	%rax
	.cfi_def_cfa_offset 64
	.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	%rdi, %rbx
	movl	%esi, %r15d
	xorl	%r12d, %r12d
	movl	$_ZSt4cout, %r13d
.LBB2_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_3 Depth 2
	xorl	%ebp, %ebp
.LBB2_3:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%rbx,%r12,8), %rax
	movl	(%rax,%rbp,4), %esi
	cmpl	$99999, %esi                    # imm = 0x1869F
	jne	.LBB2_5
# %bb.4:                                #   in Loop: Header=BB2_3 Depth=2
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$3, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB2_6
.LBB2_5:                                #   in Loop: Header=BB2_3 Depth=2
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %r14
.LBB2_6:                                #   in Loop: Header=BB2_3 Depth=2
	movl	$.L.str.1, %esi
	movl	$5, %edx
	movq	%r14, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%rbp
	cmpq	%rbp, %r15
	jne	.LBB2_3
# %bb.7:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%r12
	cmpq	%r15, %r12
	jne	.LBB2_2
# %bb.8:
	addq	$8, %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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB2_9:                                # %._crit_edge16
	retq
.Lfunc_end2:
	.size	_Z13printSolutionPPii, .Lfunc_end2-_Z13printSolutionPPii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %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	$568, %rsp                      # imm = 0x238
	.cfi_def_cfa_offset 624
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	cmpl	$2, %edi
	jl	.LBB3_1
# %bb.2:
	movq	8(%rsi), %rsi
	leaq	48(%rsp), %rbx
	movq	%rbx, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp0:
	leaq	4(%rsp), %rsi
	movq	%rbx, %rdi
	callq	_ZNSirsERi
.Ltmp1:
# %bb.3:
	movslq	4(%rsp), %r14
	leaq	(,%r14,8), %rax
	testq	%r14, %r14
	movq	$-1, %rdi
	cmovnsq	%rax, %rdi
.Ltmp2:
	callq	_Znam
.Ltmp3:
# %bb.4:                                # %.preheader84
	movq	%rax, %rbx
	movl	%r14d, %r15d
	testl	%r15d, %r15d
	jle	.LBB3_10
# %bb.5:                                # %.lr.ph87
	leaq	(,%r15,4), %r14
	xorl	%r12d, %r12d
.LBB3_6:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_8 Depth 2
.Ltmp5:
	movq	%r14, %rdi
	callq	_Znam
.Ltmp6:
# %bb.7:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB3_6 Depth=1
	movq	%rax, (%rbx,%r12,8)
	xorl	%ecx, %ecx
.LBB3_8:                                # %.lr.ph
                                        #   Parent Loop BB3_6 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$99999, (%rax,%rcx,4)           # imm = 0x1869F
	incq	%rcx
	cmpq	%rcx, %r15
	jne	.LBB3_8
# %bb.9:                                # %._crit_edge
                                        #   in Loop: Header=BB3_6 Depth=1
	incq	%r12
	cmpq	%r15, %r12
	jne	.LBB3_6
	jmp	.LBB3_10
.LBB3_14:                               #   in Loop: Header=BB3_10 Depth=1
	movl	28(%rsp), %eax
	movslq	12(%rsp), %rcx
	movq	(%rbx,%rcx,8), %rcx
	movslq	8(%rsp), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movslq	8(%rsp), %rcx
	movq	(%rbx,%rcx,8), %rcx
	movslq	12(%rsp), %rdx
	movl	%eax, (%rcx,%rdx,4)
.LBB3_10:                               # %.preheader83
                                        # =>This Inner Loop Header: Depth=1
.Ltmp8:
	leaq	48(%rsp), %rdi
	leaq	12(%rsp), %rsi
	callq	_ZNSirsERi
.Ltmp9:
# %bb.11:                               #   in Loop: Header=BB3_10 Depth=1
.Ltmp10:
	leaq	8(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZNSirsERi
.Ltmp11:
# %bb.12:                               #   in Loop: Header=BB3_10 Depth=1
.Ltmp12:
	leaq	28(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZNSirsERi
.Ltmp13:
# %bb.13:                               #   in Loop: Header=BB3_10 Depth=1
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	je	.LBB3_14
# %bb.17:
	leaq	48(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movl	4(%rsp), %ebp
	jmp	.LBB3_18
.LBB3_1:
                                        # implicit-def: $ebp
                                        # implicit-def: $rbx
.LBB3_18:
	movslq	%ebp, %r12
	leaq	(,%r12,8), %rax
	testl	%r12d, %r12d
	movq	$-1, %rdi
	cmovnsq	%rax, %rdi
	callq	_Znam
	movq	%rax, %r14
	movl	%r12d, %edi
	imull	%edi, %edi
	shlq	$2, %rdi
	movq	%rdi, 16(%rsp)                  # 8-byte Spill
	callq	_Znam
	movq	%rax, %r15
	testl	%r12d, %r12d
	jle	.LBB3_19
# %bb.24:                               # %.lr.ph90
	movq	%rbx, 40(%rsp)                  # 8-byte Spill
	leaq	(,%r12,4), %r13
	movl	%r12d, %r12d
	movq	%r14, %rbx
	xorl	%r14d, %r14d
.LBB3_25:                               # =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_Znam
	movq	%rax, (%rbx,%r14,8)
	incq	%r14
	cmpq	%r14, %r12
	jne	.LBB3_25
# %bb.20:                               # %.preheader82
	testl	%ebp, %ebp
	movq	%rbx, %r14
	movq	40(%rsp), %rbx                  # 8-byte Reload
	movq	16(%rsp), %rsi                  # 8-byte Reload
	jle	.LBB3_30
# %bb.21:                               # %.preheader81.preheader
	xorl	%eax, %eax
.LBB3_22:                               # %.preheader81
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_27 Depth 2
	testl	%ebp, %ebp
	jle	.LBB3_23
# %bb.26:                               # %.lr.ph92
                                        #   in Loop: Header=BB3_22 Depth=1
	movq	(%rbx,%rax,8), %rcx
	movq	(%r14,%rax,8), %rdx
	xorl	%esi, %esi
.LBB3_27:                               #   Parent Loop BB3_22 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rcx,%rsi,4), %edi
	movl	%edi, (%rdx,%rsi,4)
	movl	4(%rsp), %ebp
	movl	%eax, %r8d
	imull	%ebp, %r8d
	movslq	%r8d, %r8
	addq	%rsi, %r8
	movl	%edi, (%r15,%r8,4)
	incq	%rsi
	movslq	%ebp, %rdi
	cmpq	%rdi, %rsi
	jl	.LBB3_27
	jmp	.LBB3_28
.LBB3_23:                               # %.preheader81.._crit_edge93_crit_edge
                                        #   in Loop: Header=BB3_22 Depth=1
	movslq	%ebp, %rdi
.LBB3_28:                               # %._crit_edge93
                                        #   in Loop: Header=BB3_22 Depth=1
	incq	%rax
	cmpq	%rdi, %rax
	jl	.LBB3_22
# %bb.29:                               # %._crit_edge95.loopexit
	imull	%ebp, %ebp
	shlq	$2, %rbp
	movq	%rbp, %rsi
	jmp	.LBB3_30
.LBB3_19:
	movq	16(%rsp), %rsi                  # 8-byte Reload
.LBB3_30:                               # %._crit_edge95
	leaq	32(%rsp), %r13
	movq	%r13, %rdi
	callq	hipMalloc
	movq	(%r13), %rdi
	movl	4(%rsp), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	4(%rsp), %r13d
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	cmpl	$0, 4(%rsp)
	jle	.LBB3_35
# %bb.31:                               # %.lr.ph98
	movabsq	$4294967296, %rbp               # imm = 0x100000000
	leal	255(%r13), %eax
	addl	$510, %r13d                     # imm = 0x1FE
	testl	%eax, %eax
	cmovnsl	%eax, %r13d
	sarl	$8, %r13d
	btsq	$32, %r13
	xorl	%r12d, %r12d
	addq	$256, %rbp                      # imm = 0x100
.LBB3_32:                               # =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_34
# %bb.33:                               #   in Loop: Header=BB3_32 Depth=1
	movq	32(%rsp), %rsi
	movl	4(%rsp), %edx
	movq	%rbx, %rdi
	movl	%r12d, %ecx
	callq	_Z31__device_stub__vecFloydWarshallPPiS_ii
.LBB3_34:                               #   in Loop: Header=BB3_32 Depth=1
	callq	hipDeviceSynchronize
	incl	%r12d
	cmpl	4(%rsp), %r12d
	jl	.LBB3_32
.LBB3_35:                               # %._crit_edge99
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %rbx
	movq	32(%rsp), %rsi
	movl	4(%rsp), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movl	4(%rsp), %edx
	movq	%r14, %rsi
	callq	_Z13floydWarshallPPiS0_i
	movl	4(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.LBB3_42
# %bb.36:                               # %.preheader.preheader
	xorl	%eax, %eax
.LBB3_37:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_40 Depth 2
	testl	%ecx, %ecx
	jle	.LBB3_38
# %bb.39:                               # %.lr.ph101
                                        #   in Loop: Header=BB3_37 Depth=1
	movq	(%r14,%rax,8), %rdx
	xorl	%esi, %esi
.LBB3_40:                               #   Parent Loop BB3_37 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	imull	%eax, %ecx
	movslq	%ecx, %rcx
	addq	%rsi, %rcx
	movl	(%r15,%rcx,4), %ecx
	movl	%ecx, (%rdx,%rsi,4)
	incq	%rsi
	movl	4(%rsp), %ecx
	movslq	%ecx, %rdi
	cmpq	%rdi, %rsi
	jl	.LBB3_40
	jmp	.LBB3_41
.LBB3_38:                               # %.preheader.._crit_edge102_crit_edge
                                        #   in Loop: Header=BB3_37 Depth=1
	movslq	%ecx, %rdi
.LBB3_41:                               # %._crit_edge102
                                        #   in Loop: Header=BB3_37 Depth=1
	incq	%rax
	cmpq	%rdi, %rax
	jl	.LBB3_37
.LBB3_42:                               # %._crit_edge104
	subq	16(%rsp), %rbx                  # 8-byte Folded Reload
	movabsq	$1237940039285380275, %rcx      # imm = 0x112E0BE826D694B3
	movq	%rbx, %rax
	imulq	%rcx
	movq	%rdx, %rbx
	shrq	$63, %rbx
	sarq	$26, %rdx
	addq	%rdx, %rbx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$18, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movq	%rbx, %rsi
	callq	_ZNSo9_M_insertIlEERSoT_
	movl	$.L.str.3, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorl	%eax, %eax
	addq	$568, %rsp                      # imm = 0x238
	.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
.LBB3_43:                               # %.loopexit.split-lp
	.cfi_def_cfa_offset 624
.Ltmp4:
	jmp	.LBB3_16
.LBB3_44:
.Ltmp7:
	jmp	.LBB3_16
.LBB3_15:                               # %.loopexit
.Ltmp14:
.LBB3_16:
	movq	%rax, %rbx
	leaq	48(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table3:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .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 .Ltmp3-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp3
	.uleb128 .Ltmp4-.Lfunc_begin0           #     jumps to .Ltmp4
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp5-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp6-.Ltmp5                  #   Call between .Ltmp5 and .Ltmp6
	.uleb128 .Ltmp7-.Lfunc_begin0           #     jumps to .Ltmp7
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp13-.Ltmp8                 #   Call between .Ltmp8 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Lfunc_end3-.Ltmp13            #   Call between .Ltmp13 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- 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	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z16vecFloydWarshallPPiS_ii, %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_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__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	.LBB5_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
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z16vecFloydWarshallPPiS_ii,@object # @_Z16vecFloydWarshallPPiS_ii
	.section	.rodata,"a",@progbits
	.globl	_Z16vecFloydWarshallPPiS_ii
	.p2align	3, 0x0
_Z16vecFloydWarshallPPiS_ii:
	.quad	_Z31__device_stub__vecFloydWarshallPPiS_ii
	.size	_Z16vecFloydWarshallPPiS_ii, 8

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

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Computation time: "
	.size	.L.str.2, 19

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z16vecFloydWarshallPPiS_ii"
	.size	.L__unnamed_1, 28

	.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 _Z31__device_stub__vecFloydWarshallPPiS_ii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z16vecFloydWarshallPPiS_ii
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z16vecFloydWarshallPPiS_ii ; -- Begin function _Z16vecFloydWarshallPPiS_ii
	.globl	_Z16vecFloydWarshallPPiS_ii
	.p2align	8
	.type	_Z16vecFloydWarshallPPiS_ii,@function
_Z16vecFloydWarshallPPiS_ii:            ; @_Z16vecFloydWarshallPPiS_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s6, s[0:1], 0x24
	s_load_b64 s[2:3], s[0:1], 0x10
	v_and_b32_e32 v3, 0x3ff, v0
	s_add_u32 s4, s0, 24
	s_addc_u32 s5, s1, 0
	s_mov_b32 s7, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s6, s6, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s14, s6, v[3:4]
	v_cmpx_gt_i32_e64 s2, v1
	s_cbranch_execz .LBB0_8
; %bb.1:                                ; %.lr.ph42
	s_clause 0x1
	s_load_b32 s7, s[4:5], 0xc
	s_load_b64 s[8:9], s[4:5], 0x0
	s_load_b64 s[4:5], s[0:1], 0x8
	v_bfe_u32 v0, v0, 10, 10
	s_mul_i32 s1, s3, s2
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s0, s7, 16
	s_mul_i32 s6, s8, s6
	v_mad_u64_u32 v[2:3], null, s15, s0, v[0:1]
	v_mul_lo_u32 v0, s2, v1
	s_mul_i32 s7, s9, s0
	s_mul_i32 s8, s6, s2
	s_mov_b32 s9, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, s2, v2
.LBB0_2:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	s_and_saveexec_b32 s10, vcc_lo
	s_cbranch_execz .LBB0_7
; %bb.3:                                ; %.lr.ph
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b32 s0, s3
	v_mov_b32_e32 v7, v2
	v_mad_u64_u32 v[3:4], null, v1, s2, s[0:1]
	s_mov_b32 s11, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v3, s0, s4, v3
	v_add_co_ci_u32_e64 v4, s0, s5, v4, s0
.LBB0_4:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_add_nc_u32_e32 v5, s1, v7
	v_add_nc_u32_e32 v8, v0, v7
	global_load_b32 v12, v[3:4], off
	s_mov_b32 s12, exec_lo
	v_ashrrev_i32_e32 v6, 31, v5
	v_ashrrev_i32_e32 v9, 31, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[5:6], 2, v[5:6]
	v_lshlrev_b64 v[8:9], 2, v[8:9]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v10, s0, s4, v5
	v_add_co_ci_u32_e64 v11, s0, s5, v6, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v5, s0, s4, v8
	v_add_co_ci_u32_e64 v6, s0, s5, v9, s0
	s_clause 0x1
	global_load_b32 v8, v[10:11], off
	global_load_b32 v9, v[5:6], off
	s_waitcnt vmcnt(1)
	v_add_nc_u32_e32 v8, v8, v12
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_lt_i32_e64 v8, v9
	s_cbranch_execz .LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	global_store_b32 v[5:6], v8, off
.LBB0_6:                                ;   in Loop: Header=BB0_4 Depth=2
	s_or_b32 exec_lo, exec_lo, s12
	v_add_nc_u32_e32 v7, s7, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_le_i32_e64 s0, s2, v7
	s_or_b32 s11, s0, s11
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s11
	s_cbranch_execnz .LBB0_4
.LBB0_7:                                ; %Flow50
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s10
	v_add_nc_u32_e32 v1, s6, v1
	v_add_nc_u32_e32 v0, s8, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_le_i32_e64 s0, s2, v1
	s_or_b32 s9, s0, s9
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s9
	s_cbranch_execnz .LBB0_2
.LBB0_8:                                ; %Flow52
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z16vecFloydWarshallPPiS_ii
		.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	_Z16vecFloydWarshallPPiS_ii, .Lfunc_end0-_Z16vecFloydWarshallPPiS_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 460
; 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
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .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:           _Z16vecFloydWarshallPPiS_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z16vecFloydWarshallPPiS_ii.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
