#include "tensor_operator_gpu.cuh"
#include "cuda_kernels.cuh"
#include <cmath>
#include <cuda_runtime_api.h>
#include <cstdio>
#include <cublas_v2.h>

void tensor_operator_gpu::add(float* p_x, float* p_y, float* p_z, const int p_size)
{
	call_kernel(add_kernel, p_x, p_y, p_z, p_size);
}

void tensor_operator_gpu::const_add(float* p_x, const float p_y, float* p_z, const int p_size)
{
	call_kernel(const_add_kernel, p_x, p_y, p_z, p_size);
}

void tensor_operator_gpu::sub(float* p_x, float* p_y, float* p_z, const int p_size)
{
	call_kernel(sub_kernel, p_x, p_y, p_z, p_size);
}

void tensor_operator_gpu::const_sub(float* p_x, const float p_y, float* p_z, const int p_size)
{
	call_kernel(const_sub_kernel, p_x, p_y, p_z, p_size);
}

void tensor_operator_gpu::const_sub(const float p_x, float* p_y, float* p_z, const int p_size)
{
	call_kernel(const_sub_kernel, p_x, p_y, p_z, p_size);
}

void tensor_operator_gpu::mul(float* p_x, bool p_transpose_x, float* p_y, bool p_transpose_y, float* p_z, int p_rows, int p_common, int p_cols)
{
	cublasHandle_t handle;
	cublasCreate(&handle);

	const cublasOperation_t transpose_x = p_transpose_x ? CUBLAS_OP_T : CUBLAS_OP_N;
	const cublasOperation_t transpose_y = p_transpose_y ? CUBLAS_OP_T : CUBLAS_OP_N;
	const int lda = p_transpose_x ? p_rows : p_common;
	const int ldb = p_transpose_y ? p_common : p_cols;

	float alpha = 1.f;
	float beta = 0.f;


	cublasSgemm(handle,
		transpose_x, transpose_y,
		p_rows, p_common, p_cols,
		&alpha, // 1
		p_x, lda,
		p_y, ldb,
		&beta, // 0
		p_z, p_cols);

	cudaDeviceSynchronize();
}

void tensor_operator_gpu::const_mul(float* p_x, const float p_y, float* p_z, const int p_size)
{
	call_kernel(const_mul_kernel, p_x, p_y, p_z, p_size);
}

void tensor_operator_gpu::const_div(const float p_x, float* p_y, float* p_z, const int p_size)
{
	call_kernel(const_div_kernel, p_x, p_y, p_z, p_size);
}

void tensor_operator_gpu::call_kernel(void(* kernel)(const float*, const float*, float*, int), float* p_x, float* p_y, float* p_z, const int p_size)
{
	const int blockSize = 256;
	int gridSize = static_cast<int>(ceil(static_cast<float>(p_size) / blockSize));

	kernel<<<gridSize, blockSize >> >(p_x, p_y, p_z, p_size);
	const cudaError_t cuda_status = cudaGetLastError();
	if (cuda_status != cudaSuccess) {
		fprintf(stderr, "kernel launch failed: %s\n", cudaGetErrorString(cuda_status));
	}
	cudaError_t error = cudaDeviceSynchronize();
}

void tensor_operator_gpu::call_kernel(void(* kernel)(const float*, const float, float*, const int), float* p_x, const float p_y, float* p_z, const int p_size)
{
	const int blockSize = 256;
	int gridSize = static_cast<int>(ceil(static_cast<float>(p_size) / blockSize));

	kernel <<<gridSize, blockSize >> >(p_x, p_y, p_z, p_size);
	const cudaError_t cuda_status = cudaGetLastError();
	if (cuda_status != cudaSuccess) {
		fprintf(stderr, "kernel launch failed: %s\n", cudaGetErrorString(cuda_status));
	}
	cudaError_t error = cudaDeviceSynchronize();
}

void tensor_operator_gpu::call_kernel(void(* kernel)(const float, const float*, float*, const int), const float p_x, float* p_y, float* p_z, const int p_size)
{
	const int blockSize = 256;
	int gridSize = static_cast<int>(ceil(static_cast<float>(p_size) / blockSize));

	kernel <<<gridSize, blockSize >> >(p_x, p_y, p_z, p_size);
	const cudaError_t cuda_status = cudaGetLastError();
	if (cuda_status != cudaSuccess) {
		fprintf(stderr, "kernel launch failed: %s\n", cudaGetErrorString(cuda_status));
	}
	cudaError_t error = cudaDeviceSynchronize();
}

tensor_operator_gpu::tensor_operator_gpu()
= default;


tensor_operator_gpu::~tensor_operator_gpu()
= default;


	.file	"tmpxft_0034651e_00000000-6_tensor_operator_gpu.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2851:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2851:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.globl	_ZN19tensor_operator_gpu3mulEPfbS0_bS0_iii
	.type	_ZN19tensor_operator_gpu3mulEPfbS0_bS0_iii, @function
_ZN19tensor_operator_gpu3mulEPfbS0_bS0_iii:
.LFB2837:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%r8, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	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
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%ecx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%r9d, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	call	cublasCreate_v2@PLT
	movl	104(%rsp), %r9d
	testb	%r12b, %r12b
	movl	%ebx, %eax
	movl	$0x3f800000, 8(%rsp)
	cmove	96(%rsp), %eax
	testb	%bpl, %bpl
	movzbl	%r12b, %esi
	movl	$0x00000000, 12(%rsp)
	movl	%r9d, %ecx
	cmovne	96(%rsp), %ecx
	movzbl	%bpl, %edx
	pushq	%r9
	.cfi_def_cfa_offset 104
	pushq	%r15
	.cfi_def_cfa_offset 112
	leaq	28(%rsp), %rdi
	pushq	%rdi
	.cfi_def_cfa_offset 120
	pushq	%rcx
	.cfi_def_cfa_offset 128
	movl	%ebx, %ecx
	pushq	%r14
	.cfi_def_cfa_offset 136
	pushq	%rax
	.cfi_def_cfa_offset 144
	pushq	%r13
	.cfi_def_cfa_offset 152
	leaq	64(%rsp), %rax
	pushq	%rax
	.cfi_def_cfa_offset 160
	movl	160(%rsp), %r8d
	movq	80(%rsp), %rdi
	call	cublasSgemm_v2@PLT
	addq	$64, %rsp
	.cfi_def_cfa_offset 96
	call	cudaDeviceSynchronize@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$40, %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
.LFE2837:
	.size	_ZN19tensor_operator_gpu3mulEPfbS0_bS0_iii, .-_ZN19tensor_operator_gpu3mulEPfbS0_bS0_iii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"kernel launch failed: %s\n"
	.text
	.align 2
	.globl	_ZN19tensor_operator_gpu11call_kernelEPFvPKfS1_PfiES2_S2_S2_i
	.type	_ZN19tensor_operator_gpu11call_kernelEPFvPKfS1_PfiES2_S2_S2_i, @function
_ZN19tensor_operator_gpu11call_kernelEPFvPKfS1_PfiES2_S2_S2_i:
.LFB2840:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	cvtsi2ssl	%r8d, %xmm0
	movq	%rcx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%r8d, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	mulss	.LC2(%rip), %xmm0
	call	ceilf@PLT
	movl	$16777217, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2sil	%xmm0, %eax
	salq	$8, %rdx
	movl	$1, %ecx
	movl	%eax, 8(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 12(%rsp)
	movq	8(%rsp), %rdi
	movl	16(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L11
	movl	%ebx, %ecx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	*%rbp
.L11:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L12
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC3(%rip), %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L12:
	addq	$32, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	cudaDeviceSynchronize@PLT
	.cfi_endproc
.LFE2840:
	.size	_ZN19tensor_operator_gpu11call_kernelEPFvPKfS1_PfiES2_S2_S2_i, .-_ZN19tensor_operator_gpu11call_kernelEPFvPKfS1_PfiES2_S2_S2_i
	.align 2
	.globl	_ZN19tensor_operator_gpu3addEPfS0_S0_i
	.type	_ZN19tensor_operator_gpu3addEPfS0_S0_i, @function
_ZN19tensor_operator_gpu3addEPfS0_S0_i:
.LFB2832:
	.cfi_startproc
	endbr64
	movl	%ecx, %r8d
	movq	%rdx, %rcx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	_Z10add_kernelPKfS0_Pfi(%rip), %rdi
	jmp	_ZN19tensor_operator_gpu11call_kernelEPFvPKfS1_PfiES2_S2_S2_i
	.cfi_endproc
.LFE2832:
	.size	_ZN19tensor_operator_gpu3addEPfS0_S0_i, .-_ZN19tensor_operator_gpu3addEPfS0_S0_i
	.align 2
	.globl	_ZN19tensor_operator_gpu3subEPfS0_S0_i
	.type	_ZN19tensor_operator_gpu3subEPfS0_S0_i, @function
_ZN19tensor_operator_gpu3subEPfS0_S0_i:
.LFB2834:
	.cfi_startproc
	endbr64
	movl	%ecx, %r8d
	movq	%rdx, %rcx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	_Z10sub_kernelPKfS0_Pfi(%rip), %rdi
	jmp	_ZN19tensor_operator_gpu11call_kernelEPFvPKfS1_PfiES2_S2_S2_i
	.cfi_endproc
.LFE2834:
	.size	_ZN19tensor_operator_gpu3subEPfS0_S0_i, .-_ZN19tensor_operator_gpu3subEPfS0_S0_i
	.align 2
	.globl	_ZN19tensor_operator_gpu11call_kernelEPFvPKffPfiES2_fS2_i
	.type	_ZN19tensor_operator_gpu11call_kernelEPFvPKffPfiES2_fS2_i, @function
_ZN19tensor_operator_gpu11call_kernelEPFvPKffPfiES2_fS2_i:
.LFB2841:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movd	%xmm0, %r14d
	cvtsi2ssl	%ecx, %xmm0
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%ecx, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	mulss	.LC2(%rip), %xmm0
	call	ceilf@PLT
	movl	$16777217, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2sil	%xmm0, %eax
	salq	$8, %rdx
	movl	$1, %ecx
	movl	%eax, 8(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 12(%rsp)
	movq	8(%rsp), %rdi
	movl	16(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L20
	movl	%ebx, %edx
	movq	%r13, %rsi
	movd	%r14d, %xmm0
	movq	%r12, %rdi
	call	*%rbp
.L20:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L21
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC3(%rip), %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L21:
	addq	$32, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	cudaDeviceSynchronize@PLT
	.cfi_endproc
.LFE2841:
	.size	_ZN19tensor_operator_gpu11call_kernelEPFvPKffPfiES2_fS2_i, .-_ZN19tensor_operator_gpu11call_kernelEPFvPKffPfiES2_fS2_i
	.align 2
	.globl	_ZN19tensor_operator_gpu9const_addEPffS0_i
	.type	_ZN19tensor_operator_gpu9const_addEPffS0_i, @function
_ZN19tensor_operator_gpu9const_addEPffS0_i:
.LFB2833:
	.cfi_startproc
	endbr64
	movl	%edx, %ecx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	_Z16const_add_kernelPKffPfi(%rip), %rdi
	jmp	_ZN19tensor_operator_gpu11call_kernelEPFvPKffPfiES2_fS2_i
	.cfi_endproc
.LFE2833:
	.size	_ZN19tensor_operator_gpu9const_addEPffS0_i, .-_ZN19tensor_operator_gpu9const_addEPffS0_i
	.align 2
	.globl	_ZN19tensor_operator_gpu9const_subEPffS0_i
	.type	_ZN19tensor_operator_gpu9const_subEPffS0_i, @function
_ZN19tensor_operator_gpu9const_subEPffS0_i:
.LFB2835:
	.cfi_startproc
	endbr64
	movl	%edx, %ecx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	_Z16const_sub_kernelPKffPfi(%rip), %rdi
	jmp	_ZN19tensor_operator_gpu11call_kernelEPFvPKffPfiES2_fS2_i
	.cfi_endproc
.LFE2835:
	.size	_ZN19tensor_operator_gpu9const_subEPffS0_i, .-_ZN19tensor_operator_gpu9const_subEPffS0_i
	.align 2
	.globl	_ZN19tensor_operator_gpu9const_mulEPffS0_i
	.type	_ZN19tensor_operator_gpu9const_mulEPffS0_i, @function
_ZN19tensor_operator_gpu9const_mulEPffS0_i:
.LFB2838:
	.cfi_startproc
	endbr64
	movl	%edx, %ecx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	_Z16const_mul_kernelPKffPfi(%rip), %rdi
	jmp	_ZN19tensor_operator_gpu11call_kernelEPFvPKffPfiES2_fS2_i
	.cfi_endproc
.LFE2838:
	.size	_ZN19tensor_operator_gpu9const_mulEPffS0_i, .-_ZN19tensor_operator_gpu9const_mulEPffS0_i
	.align 2
	.globl	_ZN19tensor_operator_gpu11call_kernelEPFvfPKfPfiEfS2_S2_i
	.type	_ZN19tensor_operator_gpu11call_kernelEPFvfPKfPfiEfS2_S2_i, @function
_ZN19tensor_operator_gpu11call_kernelEPFvfPKfPfiEfS2_S2_i:
.LFB2842:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movd	%xmm0, %r14d
	cvtsi2ssl	%ecx, %xmm0
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%ecx, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	mulss	.LC2(%rip), %xmm0
	call	ceilf@PLT
	movl	$16777217, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2sil	%xmm0, %eax
	salq	$8, %rdx
	movl	$1, %ecx
	movl	%eax, 8(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 12(%rsp)
	movq	8(%rsp), %rdi
	movl	16(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	movl	%ebx, %edx
	movq	%r13, %rsi
	movd	%r14d, %xmm0
	movq	%r12, %rdi
	call	*%rbp
.L30:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L31
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC3(%rip), %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L31:
	addq	$32, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	cudaDeviceSynchronize@PLT
	.cfi_endproc
.LFE2842:
	.size	_ZN19tensor_operator_gpu11call_kernelEPFvfPKfPfiEfS2_S2_i, .-_ZN19tensor_operator_gpu11call_kernelEPFvfPKfPfiEfS2_S2_i
	.align 2
	.globl	_ZN19tensor_operator_gpu9const_subEfPfS0_i
	.type	_ZN19tensor_operator_gpu9const_subEfPfS0_i, @function
_ZN19tensor_operator_gpu9const_subEfPfS0_i:
.LFB2836:
	.cfi_startproc
	endbr64
	movl	%edx, %ecx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	_Z16const_sub_kernelfPKfPfi(%rip), %rdi
	jmp	_ZN19tensor_operator_gpu11call_kernelEPFvfPKfPfiEfS2_S2_i
	.cfi_endproc
.LFE2836:
	.size	_ZN19tensor_operator_gpu9const_subEfPfS0_i, .-_ZN19tensor_operator_gpu9const_subEfPfS0_i
	.align 2
	.globl	_ZN19tensor_operator_gpu9const_divEfPfS0_i
	.type	_ZN19tensor_operator_gpu9const_divEfPfS0_i, @function
_ZN19tensor_operator_gpu9const_divEfPfS0_i:
.LFB2839:
	.cfi_startproc
	endbr64
	movl	%edx, %ecx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	_Z16const_div_kernelfPKfPfi(%rip), %rdi
	jmp	_ZN19tensor_operator_gpu11call_kernelEPFvfPKfPfiEfS2_S2_i
	.cfi_endproc
.LFE2839:
	.size	_ZN19tensor_operator_gpu9const_divEfPfS0_i, .-_ZN19tensor_operator_gpu9const_divEfPfS0_i
	.align 2
	.globl	_ZN19tensor_operator_gpuC2Ev
	.type	_ZN19tensor_operator_gpuC2Ev, @function
_ZN19tensor_operator_gpuC2Ev:
.LFB2844:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE2844:
	.size	_ZN19tensor_operator_gpuC2Ev, .-_ZN19tensor_operator_gpuC2Ev
	.globl	_ZN19tensor_operator_gpuC1Ev
	.set	_ZN19tensor_operator_gpuC1Ev,_ZN19tensor_operator_gpuC2Ev
	.align 2
	.globl	_ZN19tensor_operator_gpuD2Ev
	.type	_ZN19tensor_operator_gpuD2Ev, @function
_ZN19tensor_operator_gpuD2Ev:
.LFB2847:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE2847:
	.size	_ZN19tensor_operator_gpuD2Ev, .-_ZN19tensor_operator_gpuD2Ev
	.globl	_ZN19tensor_operator_gpuD1Ev
	.set	_ZN19tensor_operator_gpuD1Ev,_ZN19tensor_operator_gpuD2Ev
	.globl	_Z37__device_stub__Z10add_kernelPKfS0_PfiPKfS0_Pfi
	.type	_Z37__device_stub__Z10add_kernelPKfS0_PfiPKfS0_Pfi, @function
_Z37__device_stub__Z10add_kernelPKfS0_PfiPKfS0_Pfi:
.LFB2873:
	.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
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 4(%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	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%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	.L40
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z10add_kernelPKfS0_Pfi(%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
.L40:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2873:
	.size	_Z37__device_stub__Z10add_kernelPKfS0_PfiPKfS0_Pfi, .-_Z37__device_stub__Z10add_kernelPKfS0_PfiPKfS0_Pfi
	.globl	_Z10add_kernelPKfS0_Pfi
	.type	_Z10add_kernelPKfS0_Pfi, @function
_Z10add_kernelPKfS0_Pfi:
.LFB2874:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z10add_kernelPKfS0_PfiPKfS0_Pfi
	.cfi_endproc
.LFE2874:
	.size	_Z10add_kernelPKfS0_Pfi, .-_Z10add_kernelPKfS0_Pfi
	.globl	_Z41__device_stub__Z16const_add_kernelPKffPfiPKffPfi
	.type	_Z41__device_stub__Z16const_add_kernelPKffPfiPKffPfi, @function
_Z41__device_stub__Z16const_add_kernelPKffPfiPKffPfi:
.LFB2875:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rcx
	leaq	56(%rsp), %rdi
	movq	%rsi, 8(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movss	%xmm0, 20(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	16(%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	.L45
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16const_add_kernelPKffPfi(%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
.L45:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L47
	call	__stack_chk_fail@PLT
.L47:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2875:
	.size	_Z41__device_stub__Z16const_add_kernelPKffPfiPKffPfi, .-_Z41__device_stub__Z16const_add_kernelPKffPfiPKffPfi
	.globl	_Z16const_add_kernelPKffPfi
	.type	_Z16const_add_kernelPKffPfi, @function
_Z16const_add_kernelPKffPfi:
.LFB2876:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z16const_add_kernelPKffPfiPKffPfi
	.cfi_endproc
.LFE2876:
	.size	_Z16const_add_kernelPKffPfi, .-_Z16const_add_kernelPKffPfi
	.globl	_Z37__device_stub__Z10sub_kernelPKfS0_PfiPKfS0_Pfi
	.type	_Z37__device_stub__Z10sub_kernelPKfS0_PfiPKfS0_Pfi, @function
_Z37__device_stub__Z10sub_kernelPKfS0_PfiPKfS0_Pfi:
.LFB2877:
	.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
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 4(%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	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%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	.L50
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z10sub_kernelPKfS0_Pfi(%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
.L50:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L52
	call	__stack_chk_fail@PLT
.L52:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2877:
	.size	_Z37__device_stub__Z10sub_kernelPKfS0_PfiPKfS0_Pfi, .-_Z37__device_stub__Z10sub_kernelPKfS0_PfiPKfS0_Pfi
	.globl	_Z10sub_kernelPKfS0_Pfi
	.type	_Z10sub_kernelPKfS0_Pfi, @function
_Z10sub_kernelPKfS0_Pfi:
.LFB2878:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z10sub_kernelPKfS0_PfiPKfS0_Pfi
	.cfi_endproc
.LFE2878:
	.size	_Z10sub_kernelPKfS0_Pfi, .-_Z10sub_kernelPKfS0_Pfi
	.globl	_Z41__device_stub__Z16const_sub_kernelPKffPfiPKffPfi
	.type	_Z41__device_stub__Z16const_sub_kernelPKffPfiPKffPfi, @function
_Z41__device_stub__Z16const_sub_kernelPKffPfiPKffPfi:
.LFB2879:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rcx
	leaq	56(%rsp), %rdi
	movq	%rsi, 8(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movss	%xmm0, 20(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	16(%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	.L55
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16const_sub_kernelPKffPfi(%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
.L55:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L57
	call	__stack_chk_fail@PLT
.L57:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2879:
	.size	_Z41__device_stub__Z16const_sub_kernelPKffPfiPKffPfi, .-_Z41__device_stub__Z16const_sub_kernelPKffPfiPKffPfi
	.globl	_Z16const_sub_kernelPKffPfi
	.type	_Z16const_sub_kernelPKffPfi, @function
_Z16const_sub_kernelPKffPfi:
.LFB2880:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z16const_sub_kernelPKffPfiPKffPfi
	.cfi_endproc
.LFE2880:
	.size	_Z16const_sub_kernelPKffPfi, .-_Z16const_sub_kernelPKffPfi
	.globl	_Z41__device_stub__Z16const_sub_kernelfPKfPfifPKfPfi
	.type	_Z41__device_stub__Z16const_sub_kernelfPKfPfifPKfPfi, @function
_Z41__device_stub__Z16const_sub_kernelfPKfPfifPKfPfi:
.LFB2881:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 16(%rsp)
	leaq	48(%rsp), %rcx
	leaq	56(%rsp), %rdi
	movq	%rsi, 8(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 24(%rsp)
	leaq	40(%rsp), %rdx
	movss	%xmm0, 28(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%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	.L60
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16const_sub_kernelfPKfPfi(%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
.L60:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L62
	call	__stack_chk_fail@PLT
.L62:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2881:
	.size	_Z41__device_stub__Z16const_sub_kernelfPKfPfifPKfPfi, .-_Z41__device_stub__Z16const_sub_kernelfPKfPfifPKfPfi
	.globl	_Z16const_sub_kernelfPKfPfi
	.type	_Z16const_sub_kernelfPKfPfi, @function
_Z16const_sub_kernelfPKfPfi:
.LFB2882:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z16const_sub_kernelfPKfPfifPKfPfi
	.cfi_endproc
.LFE2882:
	.size	_Z16const_sub_kernelfPKfPfi, .-_Z16const_sub_kernelfPKfPfi
	.globl	_Z41__device_stub__Z16const_mul_kernelPKffPfiPKffPfi
	.type	_Z41__device_stub__Z16const_mul_kernelPKffPfiPKffPfi, @function
_Z41__device_stub__Z16const_mul_kernelPKffPfiPKffPfi:
.LFB2883:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rcx
	leaq	56(%rsp), %rdi
	movq	%rsi, 8(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movss	%xmm0, 20(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	16(%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	.L65
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16const_mul_kernelPKffPfi(%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
.L65:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L67
	call	__stack_chk_fail@PLT
.L67:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2883:
	.size	_Z41__device_stub__Z16const_mul_kernelPKffPfiPKffPfi, .-_Z41__device_stub__Z16const_mul_kernelPKffPfiPKffPfi
	.globl	_Z16const_mul_kernelPKffPfi
	.type	_Z16const_mul_kernelPKffPfi, @function
_Z16const_mul_kernelPKffPfi:
.LFB2884:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z16const_mul_kernelPKffPfiPKffPfi
	.cfi_endproc
.LFE2884:
	.size	_Z16const_mul_kernelPKffPfi, .-_Z16const_mul_kernelPKffPfi
	.globl	_Z41__device_stub__Z16const_div_kernelfPKfPfifPKfPfi
	.type	_Z41__device_stub__Z16const_div_kernelfPKfPfifPKfPfi, @function
_Z41__device_stub__Z16const_div_kernelfPKfPfifPKfPfi:
.LFB2885:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 16(%rsp)
	leaq	48(%rsp), %rcx
	leaq	56(%rsp), %rdi
	movq	%rsi, 8(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 24(%rsp)
	leaq	40(%rsp), %rdx
	movss	%xmm0, 28(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%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	.L70
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16const_div_kernelfPKfPfi(%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
.L70:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L72
	call	__stack_chk_fail@PLT
.L72:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2885:
	.size	_Z41__device_stub__Z16const_div_kernelfPKfPfifPKfPfi, .-_Z41__device_stub__Z16const_div_kernelfPKfPfifPKfPfi
	.globl	_Z16const_div_kernelfPKfPfi
	.type	_Z16const_div_kernelfPKfPfi, @function
_Z16const_div_kernelfPKfPfi:
.LFB2886:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z16const_div_kernelfPKfPfifPKfPfi
	.cfi_endproc
.LFE2886:
	.size	_Z16const_div_kernelfPKfPfi, .-_Z16const_div_kernelfPKfPfi
	.section	.rodata.str1.1
.LC4:
	.string	"_Z16const_div_kernelfPKfPfi"
.LC5:
	.string	"_Z16const_mul_kernelPKffPfi"
.LC6:
	.string	"_Z16const_sub_kernelfPKfPfi"
.LC7:
	.string	"_Z16const_sub_kernelPKffPfi"
.LC8:
	.string	"_Z10sub_kernelPKfS0_Pfi"
.LC9:
	.string	"_Z16const_add_kernelPKffPfi"
.LC10:
	.string	"_Z10add_kernelPKfS0_Pfi"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2888:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -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	.LC4(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z16const_div_kernelfPKfPfi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC5(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16const_mul_kernelPKffPfi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC6(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16const_sub_kernelfPKfPfi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC7(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16const_sub_kernelPKffPfi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC8(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z10sub_kernelPKfS0_Pfi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC9(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16const_add_kernelPKffPfi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC10(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z10add_kernelPKfS0_Pfi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	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	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2888:
	.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
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC2:
	.long	998244352
	.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:

#pragma once
#include <hip/hip_runtime.h>

#ifdef _WIN64
#define COEUS_DLL_API __declspec(dllexport)
#else
#define COEUS_DLL_API 
#endif

class COEUS_DLL_API tensor_operator_gpu
{
public:
	static void add(float* p_x, float* p_y, float* p_z, int p_size);
	static void const_add(float* p_x, float p_y, float* p_z, int p_size);
	static void sub(float* p_x, float* p_y, float* p_z, int p_size);
	static void const_sub(float* p_x, float p_y, float* p_z, int p_size);
	static void const_sub(float p_x, float* p_y, float* p_z, int p_size);
	static void mul(float* p_x, bool p_transpose_x, float* p_y, bool p_transpose_y, float* p_z, int p_rows, int p_common, int p_cols);
	static void const_mul(float* p_x, float p_y, float* p_z, int p_size);
	static void const_div(float p_x, float* p_y, float* p_z, int p_size);

private:
	static void call_kernel(void(*kernel)(const float*, const float*, float*, const int), float* p_x, float* p_y, float* p_z, int p_size);
	static void call_kernel(void(*kernel)(const float*, const float, float*, const int), float* p_x, float p_y, float* p_z, int p_size);
	static void call_kernel(void(*kernel)(const float, const float*, float*, const int), float p_x, float* p_y, float* p_z, int p_size);

	tensor_operator_gpu();
	~tensor_operator_gpu();
};
	.text
	.file	"tensor_operator_gpu.hip"
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
