summaryrefslogtreecommitdiff
path: root/libcuda
diff options
context:
space:
mode:
authorJRPan <[email protected]>2025-08-18 23:09:47 -0700
committerGitHub <[email protected]>2025-08-19 06:09:47 +0000
commit21b18be3832b80b00d4890f041818bac431866e7 (patch)
tree4a8801a93a6dde20b747ef6db509215894c9f3ec /libcuda
parent33644740f15e0fa9f3d64ff98956569b2acf47bc (diff)
running formatter (#126)
* running formatter * consolidate CI runs * use cluster to run formatter * use cluster to run formatter * Add a CI-Success step
Diffstat (limited to 'libcuda')
-rw-r--r--libcuda/cuda_api.h4
-rw-r--r--libcuda/cuda_api_object.h8
-rw-r--r--libcuda/cuda_runtime_api.cc20
3 files changed, 19 insertions, 13 deletions
diff --git a/libcuda/cuda_api.h b/libcuda/cuda_api.h
index 52f36eb..5a970ba 100644
--- a/libcuda/cuda_api.h
+++ b/libcuda/cuda_api.h
@@ -2607,12 +2607,12 @@ typedef struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st {
/**
* Device that represents the CPU
*/
-#define CU_DEVICE_CPU ((CUdevice) - 1)
+#define CU_DEVICE_CPU ((CUdevice)-1)
/**
* Device that represents an invalid device
*/
-#define CU_DEVICE_INVALID ((CUdevice) - 2)
+#define CU_DEVICE_INVALID ((CUdevice)-2)
/** @} */ /* END CUDA_TYPES */
diff --git a/libcuda/cuda_api_object.h b/libcuda/cuda_api_object.h
index 3e34641..e620e57 100644
--- a/libcuda/cuda_api_object.h
+++ b/libcuda/cuda_api_object.h
@@ -35,7 +35,9 @@ struct _cuda_device_id {
m_next = NULL;
m_gpgpu = gpu;
}
- struct _cuda_device_id *next() { return m_next; }
+ struct _cuda_device_id *next() {
+ return m_next;
+ }
unsigned num_shader() const { return m_gpgpu->get_config().num_shader(); }
int num_devices() const {
if (m_next == NULL)
@@ -156,7 +158,9 @@ class kernel_config {
void set_grid_dim(dim3 *d) { m_GridDim = *d; }
void set_block_dim(dim3 *d) { m_BlockDim = *d; }
gpgpu_ptx_sim_arg_list_t get_args() { return m_args; }
- struct CUstream_st *get_stream() { return m_stream; }
+ struct CUstream_st *get_stream() {
+ return m_stream;
+ }
private:
dim3 m_GridDim;
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index 8743fe1..5317c86 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -1809,8 +1809,9 @@ cudaDeviceGetAttributeInternal(int *value, enum cudaDeviceAttr attr, int device,
case 19:
*value = 0;
break;
- case 20: // cudaDevAttrComputeMode for controlling cudaSetDevice for threads
- *value = 0; // Dummy value, should not affect simulation
+ case 20: // cudaDevAttrComputeMode for controlling cudaSetDevice for
+ // threads
+ *value = 0; // Dummy value, should not affect simulation
case 21:
case 22:
case 23:
@@ -2433,14 +2434,13 @@ void SST_gpgpusim_numcores_equal_check(unsigned sst_numcores) {
/**
* @brief For SST to check if kernel launch is blocking
- * Future: we will need a better interface to the
+ * Future: we will need a better interface to the
* GPGPU-Sim config for integration with outside
* simulators.
- *
+ *
*/
bool SST_gpgpusim_launch_blocking() {
return GPGPU_Context()->the_gpgpusim->g_stream_manager->is_blocking();
-
}
uint64_t cudaMallocSST(void **devPtr, size_t size) {
@@ -3016,7 +3016,8 @@ __host__ cudaError_t CUDARTAPI cudaStreamSynchronizeSST(cudaStream_t stream) {
return cudaSuccess;
} else {
// Otherwise we mark we should wait for default strem to sync
- ctx->the_gpgpusim->g_stream_manager->get_stream_zero()->set_request_synchronize();
+ ctx->the_gpgpusim->g_stream_manager->get_stream_zero()
+ ->set_request_synchronize();
return cudaErrorNotReady;
}
} else {
@@ -3101,7 +3102,8 @@ __host__ cudaError_t CUDARTAPI cudaEventSynchronize(cudaEvent_t event) {
printf("GPGPU-Sim API: cudaEventSynchronize ** waiting for event\n");
fflush(stdout);
CUevent_st *e = (CUevent_st *)event;
- while (!e->done());
+ while (!e->done())
+ ;
printf("GPGPU-Sim API: cudaEventSynchronize ** event detected\n");
fflush(stdout);
return g_last_cudaError = cudaSuccess;
@@ -4105,8 +4107,8 @@ cudaError_t CUDARTAPI cudaSetDeviceFlagsSST(int flags) {
// SST's simple stream example relies on this
// currently just set it to no-op
printf(
- "GPGPU-Sim PTX: Execution warning: ignoring call to \"%s ( flag=%p)\"\n",
- __my_func__, flags);
+ "GPGPU-Sim PTX: Execution warning: ignoring call to \"%s ( flag=%p)\"\n",
+ __my_func__, flags);
return cudaSuccess;
}