Commit a36e2db1 authored by Oliver Bock's avatar Oliver Bock
Browse files

Turned initial codebase into a library and an example application

* Added dedicated Makefiles
* Added support for Mac OS 10.6
* TODO: proper Linux and Windows support
* Note: we need to add licensing headers!
parent 1c51290b
# patterns
*.o
*.a
# files
clfft_example
TARGET = clfft_example
CXXFLAGS += -O3 -Wall -g -I../include
LDFLAGS += ../lib/libclfft.a
OS = $(shell uname -s)
ifeq ($(OS), Darwin)
LDFLAGS += -framework OpenCL
endif
$(TARGET): main.cpp
g++ $(CXXFLAGS) $(LDFLAGS) -o $(TARGET) main.cpp
clean:
rm -f $(TARGET)
......@@ -2,8 +2,12 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <CL/cl.h>
#include "clFFT.h"
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
#include <clFFT.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdint.h>
......@@ -120,7 +124,7 @@ int runTest(clFFT_Dim3 n, int batchSize, clFFT_Direction dir, clFFT_Dimension di
else {
// ADDED
FILE* f = fopen ("waveform", "r");
FILE* f = fopen ("test_waveform.dat", "r");
for(i = 0; i < length; i++)
{
// ADDED
......
......@@ -4,8 +4,13 @@
#ifdef __cplusplus
extern "C" {
#endif
#include <CL/cl.h>
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
#include <stdio.h>
// XForm type
......@@ -15,7 +20,7 @@ typedef enum
clFFT_Inverse = 1
}clFFT_Direction;
// XForm dimension
typedef enum
{
......
TARGET = libclfft.a
CXXFLAGS += -O3 -Wall -g -I../include
OS = $(shell uname -s)
ifeq ($(OS), Darwin)
CXXFLAGS += -I/System/Library/Frameworks
endif
OBJECTS = fft_setup.o fft_execute.o fft_kernelstring.o
$(TARGET): $(OBJECTS)
ar rcs $(TARGET) $(OBJECTS)
mkdir -p ../lib
cp $(TARGET) ../lib/
fft_setup.o: fft_setup.cpp fft_internal.h fft_base_kernels.h
g++ $(CXXFLAGS) -c fft_setup.cpp
fft_execute.o: fft_execute.cpp ../include/clFFT.h fft_internal.h
g++ $(CXXFLAGS) -c fft_execute.cpp
fft_kernelstring.o: fft_kernelstring.cpp ../include/clFFT.h fft_internal.h
g++ $(CXXFLAGS) -c fft_kernelstring.cpp
clean:
rm -f *.o
rm -f *.a
\ No newline at end of file
#include "fft_internal.h"
#include "clFFT.h"
#include <clFFT.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
......
......@@ -6,7 +6,7 @@
#include <string.h>
#include <assert.h>
#include "fft_internal.h"
#include "clFFT.h"
#include <clFFT.h>
using namespace std;
......
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