aboutsummaryrefslogtreecommitdiff
path: root/APEX_1.4/module/basicios/cuda
diff options
context:
space:
mode:
Diffstat (limited to 'APEX_1.4/module/basicios/cuda')
-rw-r--r--APEX_1.4/module/basicios/cuda/include/common.h63
-rw-r--r--APEX_1.4/module/basicios/cuda/include/compact.h17
-rw-r--r--APEX_1.4/module/basicios/cuda/include/histogram.h23
-rw-r--r--APEX_1.4/module/basicios/cuda/include/moduleList.h16
-rw-r--r--APEX_1.4/module/basicios/cuda/include/reduce.h19
-rw-r--r--APEX_1.4/module/basicios/cuda/include/scan.h25
-rw-r--r--APEX_1.4/module/basicios/cuda/include/simulate.h93
7 files changed, 256 insertions, 0 deletions
diff --git a/APEX_1.4/module/basicios/cuda/include/common.h b/APEX_1.4/module/basicios/cuda/include/common.h
new file mode 100644
index 00000000..e530b9bc
--- /dev/null
+++ b/APEX_1.4/module/basicios/cuda/include/common.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+#define APEX_CUDA_MODULE_PREFIX BasicIOS_
+
+#include "ApexCuda.h"
+#include "InplaceTypes.h"
+#include "IofxManagerIntl.h"
+#include <float.h>
+
+#if PX_WINDOWS_FAMILY
+#pragma warning(push)
+#pragma warning(disable:4201)
+#pragma warning(disable:4408)
+#endif
+
+#include <vector_types.h>
+
+#if PX_WINDOWS_FAMILY
+#pragma warning(pop)
+#endif
+
+const unsigned int HISTOGRAM_BIN_COUNT = 256;
+const unsigned int HISTOGRAM_SIMULATE_BIN_COUNT = 512;
+
+
+#define COMPACT_KERNEL_CONFIG (0, WARP_SIZE * 3)
+#define HISTOGRAM_KERNEL_CONFIG (0, HISTOGRAM_BIN_COUNT)
+#define REDUCE_KERNEL_CONFIG (0, WARP_SIZE * 4)
+#define SCAN_KERNEL_CONFIG (0, WARP_SIZE * 4)
+#define SIMULATE_KERNEL_CONFIG (0, HISTOGRAM_SIMULATE_BIN_COUNT)
+
+
+const unsigned int HOLE_SCAN_FLAG_BIT = 31;
+const unsigned int HOLE_SCAN_FLAG = (1U << HOLE_SCAN_FLAG_BIT);
+const unsigned int HOLE_SCAN_MASK = (HOLE_SCAN_FLAG - 1);
+
+// mTmpOutput
+const unsigned int STATUS_LAST_ACTIVE_COUNT = 0;
+const unsigned int STATUS_LAST_BENEFIT_SUM = 1;
+const unsigned int STATUS_LAST_BENEFIT_MIN = 2;
+const unsigned int STATUS_LAST_BENEFIT_MAX = 3;
+
+namespace nvidia
+{
+namespace basicios
+{
+
+}
+} // namespace nvidia
+
+#endif
diff --git a/APEX_1.4/module/basicios/cuda/include/compact.h b/APEX_1.4/module/basicios/cuda/include/compact.h
new file mode 100644
index 00000000..f0313c09
--- /dev/null
+++ b/APEX_1.4/module/basicios/cuda/include/compact.h
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+
+APEX_CUDA_TEXTURE_1D(texRefCompactScanSum, unsigned int)
+
+APEX_CUDA_BOUND_KERNEL(COMPACT_KERNEL_CONFIG, compactKernel,
+ ((unsigned int, targetCount))((unsigned int, totalCount))((unsigned int, injectorCount))
+ ((APEX_MEM_BLOCK(unsigned int), g_outIndices))((APEX_MEM_BLOCK(unsigned int), g_outCount))((APEX_MEM_BLOCK(unsigned int), g_injCounters))
+ )
diff --git a/APEX_1.4/module/basicios/cuda/include/histogram.h b/APEX_1.4/module/basicios/cuda/include/histogram.h
new file mode 100644
index 00000000..ca45aa5e
--- /dev/null
+++ b/APEX_1.4/module/basicios/cuda/include/histogram.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+
+APEX_CUDA_SYNC_KERNEL(HISTOGRAM_KERNEL_CONFIG, histogramSyncKernel, ((unsigned int, count))
+ ((const float*, g_data))((unsigned int, bound))
+ ((float, dataMin))((float, dataMax))((unsigned int*, g_boundParams))
+ ((unsigned int*, g_tmpHistograms))
+ )
+
+APEX_CUDA_BOUND_KERNEL(HISTOGRAM_KERNEL_CONFIG, histogramKernel,
+ ((APEX_MEM_BLOCK(float), g_data))((unsigned int, bound))
+ ((float, dataMin))((float, dataMax))((APEX_MEM_BLOCK(unsigned int), g_boundParams))
+ ((APEX_MEM_BLOCK(unsigned int), g_tmpHistograms))
+ ((unsigned int, phase))((unsigned int, gridSize))
+ )
diff --git a/APEX_1.4/module/basicios/cuda/include/moduleList.h b/APEX_1.4/module/basicios/cuda/include/moduleList.h
new file mode 100644
index 00000000..8a8749ce
--- /dev/null
+++ b/APEX_1.4/module/basicios/cuda/include/moduleList.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+
+#include "compact.h"
+#include "histogram.h"
+#include "reduce.h"
+#include "scan.h"
+#include "simulate.h"
diff --git a/APEX_1.4/module/basicios/cuda/include/reduce.h b/APEX_1.4/module/basicios/cuda/include/reduce.h
new file mode 100644
index 00000000..adde0ad7
--- /dev/null
+++ b/APEX_1.4/module/basicios/cuda/include/reduce.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+
+APEX_CUDA_SYNC_KERNEL(REDUCE_KERNEL_CONFIG, reduceSyncKernel, ((unsigned int, count))
+ ((float*, g_benefit))((float4*, g_output))((unsigned int*, g_tmp))
+ )
+
+APEX_CUDA_BOUND_KERNEL(REDUCE_KERNEL_CONFIG, reduceKernel,
+ ((APEX_MEM_BLOCK(float), g_benefit))((APEX_MEM_BLOCK(float4), g_output))((APEX_MEM_BLOCK(unsigned int), g_tmp))
+ ((unsigned int, phase))((unsigned int, gridSize))
+ )
diff --git a/APEX_1.4/module/basicios/cuda/include/scan.h b/APEX_1.4/module/basicios/cuda/include/scan.h
new file mode 100644
index 00000000..12553c5f
--- /dev/null
+++ b/APEX_1.4/module/basicios/cuda/include/scan.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+
+APEX_CUDA_SYNC_KERNEL(SCAN_KERNEL_CONFIG, scanSyncKernel, ((unsigned int, count))
+ ((float, benefitMin))((float, benefitMax))
+ ((unsigned int*, g_indices))((const float*, g_benefits))
+ ((unsigned int*, g_boundParams))
+ ((unsigned int*, g_tmpCounts))((unsigned int*, g_tmpCounts1))
+ )
+
+APEX_CUDA_BOUND_KERNEL(SCAN_KERNEL_CONFIG, scanKernel,
+ ((float, benefitMin))((float, benefitMax))
+ ((APEX_MEM_BLOCK(unsigned int), g_indices))((APEX_MEM_BLOCK(float), g_benefits))
+ ((APEX_MEM_BLOCK(unsigned int), g_boundParams))
+ ((APEX_MEM_BLOCK(unsigned int), g_tmpCounts))((APEX_MEM_BLOCK(unsigned int), g_tmpCounts1))
+ ((unsigned int, phase))((unsigned int, gridSize))
+ )
diff --git a/APEX_1.4/module/basicios/cuda/include/simulate.h b/APEX_1.4/module/basicios/cuda/include/simulate.h
new file mode 100644
index 00000000..5ade0039
--- /dev/null
+++ b/APEX_1.4/module/basicios/cuda/include/simulate.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+
+APEX_CUDA_STORAGE(simulateStorage)
+
+
+APEX_CUDA_TEXTURE_1D(texRefPositionMass, float4)
+APEX_CUDA_TEXTURE_1D(texRefVelocityLife, float4)
+APEX_CUDA_TEXTURE_1D(texRefIofxActorIDs, unsigned int)
+APEX_CUDA_TEXTURE_1D(texRefLifeSpan, float)
+APEX_CUDA_TEXTURE_1D(texRefLifeTime, float)
+APEX_CUDA_TEXTURE_1D(texRefInjector, unsigned int)
+
+APEX_CUDA_TEXTURE_1D(texRefUserData, unsigned int)
+
+APEX_CUDA_TEXTURE_1D(texRefConvexPlanes, float4)
+APEX_CUDA_TEXTURE_1D(texRefConvexVerts, float4)
+APEX_CUDA_TEXTURE_1D(texRefConvexPolygonsData, unsigned int)
+
+APEX_CUDA_TEXTURE_1D(texRefTrimeshIndices, unsigned int)
+APEX_CUDA_TEXTURE_1D(texRefTrimeshVerts, float4)
+
+APEX_CUDA_TEXTURE_1D(texRefHoleScanSum, unsigned int)
+APEX_CUDA_TEXTURE_1D(texRefMoveIndices, unsigned int)
+
+APEX_CUDA_TEXTURE_1D(texRefField, float4)
+
+
+APEX_CUDA_BOUND_KERNEL(SIMULATE_KERNEL_CONFIG, simulateKernel,
+ ((unsigned int, lastCount))((float, deltaTime))((physx::PxVec3, gravity))((physx::PxVec3, eyePos))
+ ((InplaceHandle<InjectorParamsArray>, injectorParamsArrayHandle))((unsigned int, injectorCount))
+ ((unsigned int*, g_holeScanSum))((unsigned int*, g_moveCount))((unsigned int*, g_tmpHistogram))((unsigned int*, g_InjectorsCounters))
+ ((float4*, g_positionMass))((float4*, g_velocityLife))((float4*, g_collisionNormalFlags))((unsigned int*, g_userData))
+ ((float*, g_lifeSpan))((float*, g_lifeTime))((unsigned int*, g_injector))((IofxActorIDIntl*, g_iofxActorIDs))
+ ((float*, g_benefit))((InplaceHandle<SimulationParams>, paramsHandle))
+ )
+
+APEX_CUDA_BOUND_KERNEL(SIMULATE_KERNEL_CONFIG, simulateApplyFieldKernel,
+ ((unsigned int, lastCount))((float, deltaTime))((physx::PxVec3, gravity))((physx::PxVec3, eyePos))
+ ((InplaceHandle<InjectorParamsArray>, injectorParamsArrayHandle))((unsigned int, injectorCount))
+ ((APEX_MEM_BLOCK(unsigned int), g_holeScanSum))((APEX_MEM_BLOCK(unsigned int), g_moveCount))
+ ((APEX_MEM_BLOCK(unsigned int), g_tmpHistogram))((APEX_MEM_BLOCK(unsigned int), g_InjectorsCounters))
+ ((APEX_MEM_BLOCK(float4), g_positionMass))((APEX_MEM_BLOCK(float4), g_velocityLife))
+ ((APEX_MEM_BLOCK(float4), g_collisionNormalFlags))((APEX_MEM_BLOCK(unsigned int), g_userData))
+ ((APEX_MEM_BLOCK(float), g_lifeSpan))((APEX_MEM_BLOCK(float), g_lifeTime))
+ ((APEX_MEM_BLOCK(unsigned int), g_injector))((APEX_MEM_BLOCK(IofxActorIDIntl), g_iofxActorIDs))
+ ((APEX_MEM_BLOCK(float), g_benefit))((InplaceHandle<SimulationParams>, paramsHandle))
+ )
+
+
+APEX_CUDA_BOUND_KERNEL((), mergeHistogramKernel,
+ ((APEX_MEM_BLOCK(unsigned int), g_InjectorsCounters))
+ ((APEX_MEM_BLOCK(unsigned int), g_tmpHistograms))
+ ((unsigned int, gridSize))((unsigned int, injectorCount))
+ )
+
+APEX_CUDA_BOUND_KERNEL((), stateKernel,
+ ((unsigned int, lastCount))((unsigned int, targetCount))
+ ((APEX_MEM_BLOCK(unsigned int), g_moveCount))
+ ((APEX_MEM_BLOCK(unsigned int), g_inStateToInput))((APEX_MEM_BLOCK(unsigned int), g_outStateToInput))
+ )
+
+APEX_CUDA_BOUND_KERNEL((), gridDensityGridClearKernel,
+ ((float*, gridDensityGrid))((GridDensityParams, params))
+ )
+
+APEX_CUDA_BOUND_KERNEL((), gridDensityGridFillKernel,
+ ((float4*, positionMass))((float*, gridDensityGrid))((GridDensityParams, params))
+ )
+
+APEX_CUDA_BOUND_KERNEL((), gridDensityGridApplyKernel,
+ ((float*, density))((float4*, positionMass))((float*, gridDensityGrid))((GridDensityParams, params))
+ )
+
+APEX_CUDA_BOUND_KERNEL((), gridDensityGridFillFrustumKernel,
+ ((float4*, positionMass))((float*, gridDensityGrid))((GridDensityParams, params))((::physx::PxMat44,mat))((GridDensityFrustumParams,frustum))
+ )
+
+APEX_CUDA_BOUND_KERNEL((), gridDensityGridApplyFrustumKernel,
+ ((float*, density))((float4*, positionMass))((float*, gridDensityGrid))((GridDensityParams, params))((::physx::PxMat44,mat))((GridDensityFrustumParams,frustum))
+ )
+
+APEX_CUDA_FREE_KERNEL((), gridDensityGridLowPassKernel,
+ ((float*, gridDensityGridIn))((float*, gridDensityGridOut))((GridDensityParams, params))
+ ) \ No newline at end of file