//
/*// Created by sergio on 13/02/19.
//

#include <iostream>
#include <stdint.h>  // Para medir el clock
#include <cstdlib>   // std
#include <iomanip>   // Formateo de datos
#include <string>
#define     CWIDTHLEFT      40
#define     CWIDTHRIGHT     30

#include <cuda.h>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
#include <device_functions.h>

int main(){
   int devCount = 1;

        if (devCount == 0)
        {
            std::cout << "No se detecto el modulo cuda cargado";
            exit (-1);
        }
        for (int i = 0; i < devCount; i++)
        {
            cudaDeviceProp devProp;
            cudaGetDeviceProperties (&devProp, i);

            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHLEFT) << std::setfill ('*') << " Info de la placa cuda "
                      << i << " ";
            std::cout.unsetf (std::ios::right);
            std::cout.setf (std::ios::left);
            std::cout << std::setw (CWIDTHRIGHT - 2) << std::setfill ('*') << "(todo en bytes) ";
            std::cout << std::endl;
            std::cout.unsetf (std::ios::left);

            std::cout.setf (std::ios::left);
            std::cout << std::setw (CWIDTHLEFT) << std::setfill (' ') << "Nombre:";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.name << std::endl;
            std::cout.unsetf (std::ios::right);

            std::cout << std::setw (CWIDTHLEFT) << "Total Memoria Global:";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.totalGlobalMem << std::endl;
            std::cout.unsetf (std::ios::right);

            std::cout << std::setw (CWIDTHLEFT) << "Memoria shared  por bloque (SMM): ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.sharedMemPerBlock << std::endl;
            std::cout.unsetf (std::ios::right);
            std::cout << std::setw (CWIDTHLEFT) << "Registros por bloque: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.regsPerBlock << std::endl;
            std::cout.unsetf (std::ios::right);
            std::cout << std::setw (CWIDTHLEFT) << "Wrap size: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.warpSize << std::endl;
            std::cout.unsetf (std::ios::right);
            std::cout << std::setw (CWIDTHLEFT) << "Max threads por bloque: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.maxThreadsPerBlock << std::endl;
            std::cout.unsetf (std::ios::right);
            std::cout << std::setw (CWIDTHLEFT) << "Max threads por SMM: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.maxThreadsPerMultiProcessor
                      << std::endl;
            std::cout.unsetf (std::ios::right);
            //Dimeciones maximas por bloque
            for (int j = 0; j < 3; ++j)
            {
                // c++11
                std::string sstr = "Dimecion maxima " + std::to_string (j) + " por bloque:";
                std::cout << std::setw (CWIDTHLEFT) << sstr;
                std::cout.setf (std::ios::right);
                std::cout << std::setw (CWIDTHRIGHT) << devProp.maxThreadsDim[j] << std::endl;
                std::cout.unsetf (std::ios::right);
            }
            //Dimeciones maximas por grid
            for (int j = 0; j < 3; ++j)
            {
                // c++11
                std::string sstr = "Dimecion maxima " + std::to_string (j) + " por grid:";
                std::cout << std::setw (CWIDTHLEFT) << sstr;
                std::cout.setf (std::ios::right);
                std::cout << std::setw (CWIDTHRIGHT) << devProp.maxGridSize[j] << std::endl;
                std::cout.unsetf (std::ios::right);
            }

            std::cout << std::setw (CWIDTHLEFT) << "Clock rate: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.clockRate << std::endl;
            std::cout.unsetf (std::ios::right);

            std::cout << std::setw (CWIDTHLEFT) << "Total Memoria constante: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.totalConstMem << std::endl;
            std::cout.unsetf (std::ios::right);

            std::cout << std::setw (CWIDTHLEFT) << "Soporta copia y ejecucion concurrente: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << (devProp.deviceOverlap ? "Sep" : "No")
                      << std::endl;
            std::cout.unsetf (std::ios::right);

            std::cout << std::setw (CWIDTHLEFT) << "Multiprocesadores: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.multiProcessorCount << std::endl;
            std::cout.unsetf (std::ios::right);

            // Calculo de cuda cores
            int mp = devProp.multiProcessorCount;
            int cores;
            switch (devProp.major)
            {
                case 2: // Fermi
                    if (devProp.minor == 1)
                        cores = mp * 48;
                    else
                        cores = mp * 32;
                    break;
                case 3: // Kepler
                    cores = mp * 192;
                    break;
                case 5: // Maxwell
                    cores = mp * 128;
                    break;
                case 6: // Pascal
                    if (devProp.minor == 1)
                        cores = mp * 128;
                    else if (devProp.minor == 0)
                        cores = mp * 64;
                    else
                        std::cout << " desconocido ";
                    break;
                default:
                    std::cout << " desconocido ";
                    break;
            }
            std::cout << std::setw (CWIDTHLEFT) << "Cuda cores: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << cores << std::endl;
            std::cout.unsetf (std::ios::right);

        }


}

*/

	.file	"tmpxft_002ae73a_00000000-6_cudainfo.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2010:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2010:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2033:
	.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
.LFE2033:
	.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>
//
/*// Created by sergio on 13/02/19.
//

#include <iostream>
#include <stdint.h>  // Para medir el clock
#include <cstdlib>   // std
#include <iomanip>   // Formateo de datos
#include <string>
#define     CWIDTHLEFT      40
#define     CWIDTHRIGHT     30

#include <cuda.h>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
#include <device_functions.h>

int main(){
   int devCount = 1;

        if (devCount == 0)
        {
            std::cout << "No se detecto el modulo cuda cargado";
            exit (-1);
        }
        for (int i = 0; i < devCount; i++)
        {
            cudaDeviceProp devProp;
            cudaGetDeviceProperties (&devProp, i);

            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHLEFT) << std::setfill ('*') << " Info de la placa cuda "
                      << i << " ";
            std::cout.unsetf (std::ios::right);
            std::cout.setf (std::ios::left);
            std::cout << std::setw (CWIDTHRIGHT - 2) << std::setfill ('*') << "(todo en bytes) ";
            std::cout << std::endl;
            std::cout.unsetf (std::ios::left);

            std::cout.setf (std::ios::left);
            std::cout << std::setw (CWIDTHLEFT) << std::setfill (' ') << "Nombre:";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.name << std::endl;
            std::cout.unsetf (std::ios::right);

            std::cout << std::setw (CWIDTHLEFT) << "Total Memoria Global:";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.totalGlobalMem << std::endl;
            std::cout.unsetf (std::ios::right);

            std::cout << std::setw (CWIDTHLEFT) << "Memoria shared  por bloque (SMM): ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.sharedMemPerBlock << std::endl;
            std::cout.unsetf (std::ios::right);
            std::cout << std::setw (CWIDTHLEFT) << "Registros por bloque: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.regsPerBlock << std::endl;
            std::cout.unsetf (std::ios::right);
            std::cout << std::setw (CWIDTHLEFT) << "Wrap size: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.warpSize << std::endl;
            std::cout.unsetf (std::ios::right);
            std::cout << std::setw (CWIDTHLEFT) << "Max threads por bloque: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.maxThreadsPerBlock << std::endl;
            std::cout.unsetf (std::ios::right);
            std::cout << std::setw (CWIDTHLEFT) << "Max threads por SMM: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.maxThreadsPerMultiProcessor
                      << std::endl;
            std::cout.unsetf (std::ios::right);
            //Dimeciones maximas por bloque
            for (int j = 0; j < 3; ++j)
            {
                // c++11
                std::string sstr = "Dimecion maxima " + std::to_string (j) + " por bloque:";
                std::cout << std::setw (CWIDTHLEFT) << sstr;
                std::cout.setf (std::ios::right);
                std::cout << std::setw (CWIDTHRIGHT) << devProp.maxThreadsDim[j] << std::endl;
                std::cout.unsetf (std::ios::right);
            }
            //Dimeciones maximas por grid
            for (int j = 0; j < 3; ++j)
            {
                // c++11
                std::string sstr = "Dimecion maxima " + std::to_string (j) + " por grid:";
                std::cout << std::setw (CWIDTHLEFT) << sstr;
                std::cout.setf (std::ios::right);
                std::cout << std::setw (CWIDTHRIGHT) << devProp.maxGridSize[j] << std::endl;
                std::cout.unsetf (std::ios::right);
            }

            std::cout << std::setw (CWIDTHLEFT) << "Clock rate: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.clockRate << std::endl;
            std::cout.unsetf (std::ios::right);

            std::cout << std::setw (CWIDTHLEFT) << "Total Memoria constante: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.totalConstMem << std::endl;
            std::cout.unsetf (std::ios::right);

            std::cout << std::setw (CWIDTHLEFT) << "Soporta copia y ejecucion concurrente: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << (devProp.deviceOverlap ? "Sep" : "No")
                      << std::endl;
            std::cout.unsetf (std::ios::right);

            std::cout << std::setw (CWIDTHLEFT) << "Multiprocesadores: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << devProp.multiProcessorCount << std::endl;
            std::cout.unsetf (std::ios::right);

            // Calculo de cuda cores
            int mp = devProp.multiProcessorCount;
            int cores;
            switch (devProp.major)
            {
                case 2: // Fermi
                    if (devProp.minor == 1)
                        cores = mp * 48;
                    else
                        cores = mp * 32;
                    break;
                case 3: // Kepler
                    cores = mp * 192;
                    break;
                case 5: // Maxwell
                    cores = mp * 128;
                    break;
                case 6: // Pascal
                    if (devProp.minor == 1)
                        cores = mp * 128;
                    else if (devProp.minor == 0)
                        cores = mp * 64;
                    else
                        std::cout << " desconocido ";
                    break;
                default:
                    std::cout << " desconocido ";
                    break;
            }
            std::cout << std::setw (CWIDTHLEFT) << "Cuda cores: ";
            std::cout.setf (std::ios::right);
            std::cout << std::setw (CWIDTHRIGHT) << cores << std::endl;
            std::cout.unsetf (std::ios::right);

        }


}

*/

	.text
	.file	"cudainfo.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
