mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2025-04-10 18:22:11 +01:00
Compare commits
3 Commits
e762d58260
...
940a4c7a91
Author | SHA1 | Date | |
---|---|---|---|
![]() |
940a4c7a91 | ||
![]() |
61bd39800d | ||
![]() |
8a96d2eee7 |
@ -241,7 +241,7 @@ inline int gpuGetMaxGflopsDeviceIdDRV() {
|
||||
}
|
||||
|
||||
unsigned long long compute_perf =
|
||||
(unsigned long long)(multiProcessorCount * sm_per_multiproc *
|
||||
((unsigned long long)multiProcessorCount * sm_per_multiproc *
|
||||
clockRate);
|
||||
|
||||
if (compute_perf > max_compute_perf) {
|
||||
|
@ -57,7 +57,7 @@ int main(int argc, char **argv) {
|
||||
// Get GPU information
|
||||
checkCudaErrors(cudaGetDevice(&devID));
|
||||
checkCudaErrors(cudaGetDeviceProperties(&props, devID));
|
||||
printf("Device %d: \"%s\" with Compute %d.%d capability\n", devID, props.name,
|
||||
printf("Device %d: \"%s\" with Compute capability %d.%d\n", devID, props.name,
|
||||
props.major, props.minor);
|
||||
|
||||
printf("printf() is called. Output:\n\n");
|
||||
|
@ -31,7 +31,6 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include "cuda.h"
|
||||
@ -293,6 +292,11 @@ static void memMapGetDeviceFunction(char **argv) {
|
||||
jitNumOptions, jitOptions,
|
||||
(void **)jitOptVals));
|
||||
printf("> PTX JIT log:\n%s\n", jitLogBuffer);
|
||||
|
||||
// Clean up dynamically allocated memory
|
||||
delete[] jitOptions;
|
||||
delete[] jitOptVals;
|
||||
delete[] jitLogBuffer;
|
||||
} else {
|
||||
checkCudaErrors(cuModuleLoad(&cuModule, module_path.c_str()));
|
||||
}
|
||||
@ -379,7 +383,7 @@ static void childProcess(int devId, int id, char **argv) {
|
||||
// deterministic.
|
||||
barrierWait(&shm->barrier, &shm->sense, (unsigned int)procCount);
|
||||
if (id == 0) {
|
||||
printf("Step %lld done\n", (unsigned long long)i);
|
||||
printf("Step %llu done\n", (unsigned long long)i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -550,7 +554,7 @@ static void parentProcess(char *app) {
|
||||
// Launch the child processes!
|
||||
for (i = 0; i < nprocesses; i++) {
|
||||
char devIdx[10];
|
||||
char procIdx[10];
|
||||
char procIdx[12];
|
||||
char *const args[] = {app, devIdx, procIdx, NULL};
|
||||
Process process;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user