Commit d7e32b4a authored by Gaurav Kukreja's avatar Gaurav Kukreja

Merge branch 'master' of https://github.com/gkernel/cuda_lab

parents 3036349a 90638d4c
...@@ -6,8 +6,5 @@ image_result.png ...@@ -6,8 +6,5 @@ image_result.png
*.project *.project
*.settings *.settings
*.settings/* *.settings/*
miklos/sample_qt_opengl_cuda_shit_without_camera/moc_glwidget.cpp moc_*.cpp
miklos/sample_qt_opengl_cuda_shit_without_camera/Makefile
miklos/sample_qt_opengl_cuda_shit_without_camera/hello-opengl
*.o *.o
QT += core gui opengl QT += core gui opengl
CONFIG += debug CONFIG += debug
TARGET = hello-opengl TARGET = main
TEMPLATE = app TEMPLATE = app
......
...@@ -12,7 +12,6 @@ public: ...@@ -12,7 +12,6 @@ public:
explicit GlWidget(QWidget *parent = 0); explicit GlWidget(QWidget *parent = 0);
~GlWidget(); ~GlWidget();
QSize sizeHint() const; QSize sizeHint() const;
float *d_in;
protected: protected:
void initializeGL(); void initializeGL();
...@@ -20,6 +19,7 @@ protected: ...@@ -20,6 +19,7 @@ protected:
private: private:
QGLFunctions gl; QGLFunctions gl;
float *d_in;
}; };
#endif // GLWIDGET_H #endif // GLWIDGET_H
...@@ -107,7 +107,7 @@ inline dim3 make_grid(dim3 whole, dim3 block) ...@@ -107,7 +107,7 @@ inline dim3 make_grid(dim3 whole, dim3 block)
static float *d_T, *d_F, *d_Xi, *d_Xj; static float *d_T, *d_F, *d_Xi, *d_Xj;
void allocate_device_memory(float *d_in, size_t w, size_t h) void allocate_device_memory(size_t w, size_t h)
{ {
size_t imageBytes = w*h*sizeof(float); size_t imageBytes = w*h*sizeof(float);
cudaMalloc(&d_T, imageBytes); cudaMalloc(&d_T, imageBytes);
......
#ifndef KERNEL_H #ifndef KERNEL_H
#define KERNEL_H #define KERNEL_H
extern "C" void allocate_device_memory(float *d_in, size_t width, size_t height); extern "C" void allocate_device_memory(size_t width, size_t height);
extern "C" void executeKernel(float *d_in, void *d_out, size_t width, size_t height); extern "C" void executeKernel(float *d_in, void *d_out, size_t width, size_t height);
#endif // KERNEL_H #endif // KERNEL_H
...@@ -17,7 +17,7 @@ int main(int argc, char *argv[]) ...@@ -17,7 +17,7 @@ int main(int argc, char *argv[])
} }
QObject::connect(&camera, SIGNAL(newFrame()), &w, SLOT(updateGL())); QObject::connect(&camera, SIGNAL(newFrame()), &w, SLOT(updateGL()));
allocate_device_memory(w.d_in, camera.width(), camera.height()); allocate_device_memory(camera.width(), camera.height());
camera.start(); camera.start();
w.show(); w.show();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment