You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
519 B
31 lines
519 B
8 years ago
|
|
||
|
#include <cuda.h>
|
||
|
#include <iostream>
|
||
|
#include <string>
|
||
|
|
||
|
#ifdef _WIN32
|
||
|
#define EXPORT __declspec(dllexport)
|
||
|
#else
|
||
|
#define EXPORT
|
||
|
#endif
|
||
|
|
||
|
int dynamic_base_func(int);
|
||
|
|
||
|
EXPORT int __host__ cuda_dynamic_host_func(int x)
|
||
|
{
|
||
|
return dynamic_base_func(x);
|
||
|
}
|
||
|
|
||
|
static __global__ void DetermineIfValidCudaDevice()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
EXPORT void cuda_dynamic_lib_func()
|
||
|
{
|
||
|
DetermineIfValidCudaDevice<<<1, 1>>>();
|
||
|
cudaError_t err = cudaGetLastError();
|
||
|
if (err == cudaSuccess) {
|
||
|
std::cerr << cudaGetErrorString(err) << std::endl;
|
||
|
}
|
||
|
}
|