A tool for evaluating multiple NURBS curve/surface points using the GPU.
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.
|
|
|
#ifndef UNTITLED1_UTILS_H
|
|
|
|
#define UNTITLED1_UTILS_H
|
|
|
|
|
|
|
|
#define IN_UNIX 0 // 确定当前运行的操作系统(需要通过系统调用获得时间)
|
|
|
|
|
|
|
|
#if IN_UNIX
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <ctime>
|
|
|
|
double get_time();
|
|
|
|
#else
|
|
|
|
#include <windows.h>
|
|
|
|
#include "device/Nurbs/bvh.cuh"
|
|
|
|
|
|
|
|
double get_time();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 保证释放后的指针指向空。这样一来保证指针不乱指,free的时候不会出错、二来可以判断指针是否已经free
|
|
|
|
* 注意指针是引用传参,因为要把指针本身置空
|
|
|
|
*/
|
|
|
|
void safeCudaFree(float *&p);
|
|
|
|
void safeCudaFree(BVHNode *&p);
|
|
|
|
//template<typename T>
|
|
|
|
void safeFree(float *&p);
|
|
|
|
void safeFree(BVHNode *&p);
|
|
|
|
|
|
|
|
|
|
|
|
#endif //UNTITLED1_UTILS_H
|