Description Usage Arguments Value Author(s) References See Also Examples
These functions allow us to profile CUDA interactions
and calls. We can profile an entire sequence of one or more
R calls. Alternatively, we can use more fine-grained control
over what we profile by first creating a profiler and then
starting and stopping it as we want.
We can read the profiling results with readCUDAProfile
although profileCUDA
returns them for us.
There are two possible formats for the profiling result file.
One is a CSV. The other is a name=value
format.
We can specify what to profile via a configuration file.
1 2 3 4 5 6 7 | profileCUDA(expr, file = tempfile(), ...)
cudaProfiler(file = tempfile(),
config = getOption("CUDAProfilerConfig",
system.file('prof.config', package = 'RCUDA')),
format = "csv", start = TRUE)
cudaStartProfiler()
cudaStopProfiler()
|
expr |
the R expression or set of expressions to profile as a single block |
file |
the name of the file to which to write the profiling results. This defaults to a temporary file. |
... |
additional arguments passed to |
config |
the name of a configuration file identifying what counters to store, i.e. the names of the columns of the data frame and what the profiler will record for each routine. |
format |
the format of the data the profiler will output.
This is either CSV or key=value pairs. One can specify this with
either of the |
start |
a logical value that controls whether we also start the
profiler immedialtey after creating it ( |
profileCUDA
returns a data frame.
Duncan Temple Lang
http://docs.nvidia.com/cuda/profiler-users-guide/index.html
A sample configuration file is available at https://svn.ece.lsu.edu/svn/gp/cuda/matrix-mult/.cuda-profile-config
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | if(getNumDevices() > 0) {
createContext()
info = profileCUDA( {
ptx = system.file("sampleKernels", "dnormOutput.ptx", package = "RCUDA")
m = loadModule(ptx)
kernel = m$dnorm_kernel
N = 1e6L
x = rnorm(N)
ans = .cuda(kernel, x, N, .5, 1.5, numeric(N),
gridDim = c(64L, 32L), blockDim = 512L, outputs = "out")
})
info
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.