-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use read only cache instead of texture cache for CC >= 3.5
- Loading branch information
1 parent
b1772a3
commit 6b40d01
Showing
5 changed files
with
95 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include "gpuConfig.H" | ||
|
||
namespace Foam { | ||
|
||
int deviceCount() | ||
{ | ||
int num_devices; | ||
CUDA_CALL(cudaGetDeviceCount(&num_devices)); | ||
return num_devices; | ||
} | ||
|
||
int currentDevice() | ||
{ | ||
int device; | ||
CUDA_CALL(cudaGetDevice(&device)); | ||
return device; | ||
} | ||
|
||
void setCurrentDevice(int device) | ||
{ | ||
CUDA_CALL(cudaSetDevice(device)); | ||
} | ||
|
||
int deviceComputeCapability(int device) | ||
{ | ||
cudaDeviceProp deviceProp; | ||
CUDA_CALL(cudaGetDeviceProperties(&deviceProp, device)); | ||
return 10*deviceProp.major + deviceProp.minor; | ||
} | ||
|
||
int currentComputeCapability() | ||
{ | ||
return deviceComputeCapability(currentDevice()); | ||
} | ||
|
||
bool needTextureBind() | ||
{ | ||
static bool needBind = currentComputeCapability() < 35; | ||
return needBind; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters