Class CUDAProfiler
- java.lang.Object
-
- org.lwjgl.cuda.CUDAProfiler
-
public class CUDAProfiler extends java.lang.ObjectContains bindings to CUDA profiler control functions of the low-level CUDA driver API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCUDAProfiler.FunctionsContains the function pointers loaded fromCU.getLibrary().
-
Field Summary
Fields Modifier and Type Field Description static intCU_OUT_CSV
CU_OUT_KEY_VALUE_PAIRProfiler Output Modes.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcuProfilerInitialize(java.lang.CharSequence configFile, java.lang.CharSequence outputFile, int outputMode)Initialize the profiling.static intcuProfilerInitialize(java.nio.ByteBuffer configFile, java.nio.ByteBuffer outputFile, int outputMode)Initialize the profiling.static intcuProfilerStart()Enable profiling.static intcuProfilerStop()Disable profiling.static intncuProfilerInitialize(long configFile, long outputFile, int outputMode)Unsafe version of:ProfilerInitialize
-
-
-
Field Detail
-
CU_OUT_KEY_VALUE_PAIR, CU_OUT_CSV
Profiler Output Modes. (CUoutput_modeEnum values:
OUT_KEY_VALUE_PAIR- Output mode Key-Value pair format.OUT_CSV- Output mode Comma separated values format.
-
-
Method Detail
-
ncuProfilerInitialize
public static int ncuProfilerInitialize(long configFile, long outputFile, int outputMode)Unsafe version of:ProfilerInitialize
-
cuProfilerInitialize
public static int cuProfilerInitialize(java.nio.ByteBuffer configFile, java.nio.ByteBuffer outputFile, int outputMode) public static int cuProfilerInitialize(java.lang.CharSequence configFile, java.lang.CharSequence outputFile, int outputMode)Initialize the profiling. Deprecated.Using this API user can initialize the CUDA profiler by specifying the configuration file, output file and output file format. This API is generally used to profile different set of counters by looping the kernel launch. The
configFileparameter can be used to select profiling options including profiler counters. Refer to the "Compute Command Line Profiler User Guide" for supported profiler options and counters.Limitation: The CUDA profiler cannot be initialized with this API if another profiling tool is already active, as indicated by the
CU.CUDA_ERROR_PROFILER_DISABLEDreturn code.Typical usage of the profiling APIs is as follows:
for each set of counters/options { cuProfilerInitialize(); //Initialize profiling, set the counters or options in the config file ... cuProfilerStart(); // code to be profiled cuProfilerStop(); ... cuProfilerStart(); // code to be profiled cuProfilerStop(); ... }- Parameters:
configFile- name of the config file that lists the counters/options for profilingoutputFile- name of the outputFile where the profiling results will be storedoutputMode- one of:OUT_KEY_VALUE_PAIROUT_CSV
-
cuProfilerStart
public static int cuProfilerStart()
Enable profiling.Enables profile collection by the active profiling tool for the current context. If profiling is already enabled, then
cuProfilerStart()has no effect.cuProfilerStartandProfilerStopAPIs are used to programmatically control the profiling granularity by allowing profiling to be done only on selective pieces of code.
-
cuProfilerStop
public static int cuProfilerStop()
Disable profiling.Disables profile collection by the active profiling tool for the current context. If profiling is already disabled, then
cuProfilerStop()has no effect.ProfilerStartandcuProfilerStopAPIs are used to programmatically control the profiling granularity by allowing profiling to be done only on selective pieces of code.
-
-