.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_gpu.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Run this example online : - Click :ref:`here ` to download the full example code - Then start `Radis-Lab `__, upload the Jupyter notebook, and run it from there. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_gpu.py: ======================= GPU Accelerated Spectra ======================= Example using GPU calculation with :py:meth:`~radis.lbl.SpectrumFactory.eq_spectrum_gpu` This method requires CUDA compatible hardware to execute. For more information on how to setup your system to run GPU-accelerated methods using CUDA and Cython, check :ref:`GPU Spectrum Calculation on RADIS ` .. note:: in the example below, the GPU code runs on CPU, using the parameter ``emulate=True``. In your environment, to run the GPU code with the full power of the GPU, remove this line or set ``emulate=False`` (default) .. GENERATED FROM PYTHON SOURCE LINES 20-44 .. image-sg:: /auto_examples/images/sphx_glr_plot_gpu_001.png :alt: plot gpu :srcset: /auto_examples/images/sphx_glr_plot_gpu_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none HITEMP keep only relevant input files: ['/home/docs/.radisdb/hitemp/CO2-02_02125-02250_HITEMP2010.hdf5', '/home/docs/.radisdb/hitemp/CO2-02_02250-02500_HITEMP2010.hdf5'] HITEMP keep only relevant input files: [] HITEMP keep only relevant input files: ['/home/docs/.radisdb/hitemp/CO2-02_02125-02250_HITEMP2010.hdf5', '/home/docs/.radisdb/hitemp/CO2-02_02250-02500_HITEMP2010.hdf5'] Number of lines loaded: 1128265 Finished calculating spectrum! 1.24s - Spectrum calculated Spectrum Name: CO2-hitemp-radisdb-1100.0K-#5456 Spectral Quantities ---------------------------------------- abscoeff [cm-1] (150,001 points) absorbance (150,001 points) emissivity (150,001 points) emissivity_noslit (150,001 points) transmittance_noslit (150,001 points) radiance_noslit [mW/cm2/sr/cm-1] (150,001 points) transmittance (150,001 points) Physical Conditions ---------------------------------------- Tgas 1100.0 K Trot 1100.0 K Tvib 1100.0 K isotope 1,2,3 mole_fraction 0.8 molecule CO2 overpopulation None path_length 0.2 cm pressure_mbar 1000.0 mbar rot_distribution boltzmann self_absorption True state X thermal_equilibrium True vib_distribution boltzmann wavenum_max 2450.0000 cm-1 wavenum_min 2150.0000 cm-1 Computation Parameters ---------------------------------------- NwG 3 NwL 6 Tref 296 K add_at_used broadening_method voigt cutoff 0 cm-1/(#.cm-2) dbformat hitemp-radisdb dbpath /home/docs/.radisdb/hitemp/CO2-02_02125-02250_HITEMP2010.hdf5,/home/docs/.radisdb/hitemp/CO2-02_0225... default_output_unit cm-1 emulate_gpu True folding_thresh 1e-06 include_neighbouring_lines True memory_mapping_engine auto neighbour_lines 0 cm-1 optimization simple parfuncfmt hapi parsum_mode full summation profiler {'spectrum_calculation': {'scaled_S0': 0.0367154770065099, 'calc_other_spectral_quan': 0.01340713699... pseudo_continuum_threshold 0 radis_version 0.13.1 sparse_ldm auto spectral_points 150000.0 truncation 50 cm-1 waveunit cm-1 wstep 0.002 cm-1 zero_padding -1 Config parameters ---------------------------------------- DEFAULT_DOWNLOAD_PATH ~/.radisdb GRIDPOINTS_PER_LINEWIDTH_ERROR_THRESHOLD 1 GRIDPOINTS_PER_LINEWIDTH_WARN_THRESHOLD 3 SPARSE_WAVERANGE auto Information ---------------------------------------- calculation_time 1.2341494829888688 s chunksize None db_use_cached True dxG 0.13753507880165727 dxL 0.20180288881201608 export_lines False export_populations None export_rovib_fraction False levelsfmt radis lines_calculated 1,128,265 load_energies False lvl_use_cached True parfuncpath None total_lines 1128265 warning_broadening_threshold 0.01 warning_linestrength_cutoff 0.01 wavenum_max_calc 2450.0000 cm-1 wavenum_min_calc 2150.0000 cm-1 ---------------------------------------- | .. code-block:: default from radis import SpectrumFactory sf = SpectrumFactory( 2150, 2450, # cm-1 molecule="CO2", isotope="1,2,3", wstep=0.002, ) sf.fetch_databank("hitemp") s = sf.eq_spectrum_gpu( Tgas=1100.0, # K pressure=1, # bar mole_fraction=0.8, path_length=0.2, # cm emulate=True, # if True, runs CPU code on GPU. Set to False or remove to run on the GPU ) print(s) s.apply_slit(0.5) # cm-1 s.plot("radiance", show=True) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 2.408 seconds) .. _sphx_glr_download_auto_examples_plot_gpu.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_gpu.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_gpu.ipynb `