Nsound
0.9.4
Main Page
Namespaces
Classes
Files
File List
File Members
Nsound
CudaUtils.h
Go to the documentation of this file.
1
//-----------------------------------------------------------------------------
2
//
3
// $Id: CudaUtils.h 874 2014-09-08 02:21:29Z weegreenblobbie $
4
//
5
// Nsound is a C++ library and Python module for audio synthesis featuring
6
// dynamic digital filters. Nsound lets you easily shape waveforms and write
7
// to disk or plot them. Nsound aims to be as powerful as Csound but easy to
8
// use.
9
//
10
// Copyright (c) 2008 to Present Nick Hilton
11
//
12
// weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
13
//
14
//-----------------------------------------------------------------------------
15
16
//-----------------------------------------------------------------------------
17
//
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
22
//
23
// This program is distributed in the hope that it will be useful,
24
// but WITHOUT ANY WARRANTY; without even the implied warranty of
25
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
// GNU Library General Public License for more details.
27
//
28
// You should have received a copy of the GNU General Public License
29
// along with this program; if not, write to the Free Software
30
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31
//
32
//-----------------------------------------------------------------------------
33
#ifndef _NSOUND_CUDA_UTILS_H_
34
#define _NSOUND_CUDA_UTILS_H_
35
36
namespace
Nsound
37
{
38
39
//-----------------------------------------------------------------------------
40
// Magic macro to check for cuda errors.
41
#define checkForCudaError() \
42
{ \
43
cudaError_t ecode = cudaGetLastError(); \
44
if(ecode) \
45
{ \
46
printf("%s:%3d: Error: %s\n", \
47
__FILE__, \
48
__LINE__, \
49
cudaGetErrorString(ecode)); \
50
} \
51
}
52
53
struct
Context
54
{
55
enum
State
56
{
57
BOOTING_
= 1,
58
INITALIZED_
= 10,
59
UNLOADED_
= 20,
60
ERROR_
= 30,
61
};
62
63
static
State
state_
;
64
66
void
67
init
(
int
flags = 0);
68
};
69
70
}
// namespace
71
72
#endif
73
// :mode=c++: jEdit modeline
Nsound::Context::state_
static State state_
Definition:
CudaUtils.h:63
Nsound::Context::init
void init(int flags=0)
Initialize the card once.
Nsound::Context::State
State
Definition:
CudaUtils.h:55
Nsound::Context
Definition:
CudaUtils.h:53
Nsound::Context::BOOTING_
Definition:
CudaUtils.h:57
Nsound::Context::UNLOADED_
Definition:
CudaUtils.h:59
Nsound::Context::ERROR_
Definition:
CudaUtils.h:60
Nsound::Context::INITALIZED_
Definition:
CudaUtils.h:58
Generated on Sun Aug 23 2015 11:51:50 for Nsound by
1.8.6