00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __VM_SPUMath__
00021 #define __VM_SPUMath__
00022
00023 #include "VM_API.h"
00024 #include <SYS/SYS_Types.h>
00025
00026
00027 typedef enum
00028 {
00029 VM_SPU_ADD,
00030 VM_SPU_MUL,
00031 VM_SPU_SUB,
00032 VM_SPU_DIV,
00033 VM_SPU_SQRT,
00034 VM_SPU_MADD,
00035 VM_SPU_SCALEOFFSET,
00036 VM_SPU_DOT,
00037 } VM_SPUOp;
00038
00039 class VM_API VM_SPUMath
00040 {
00041 public:
00042 virtual ~VM_SPUMath() {}
00043
00044
00045
00046 virtual bool canRun(int n) const = 0;
00047
00048 virtual void arrayOp(VM_SPUOp op,
00049 fpreal32 *d,
00050 const fpreal32 *a,
00051 const fpreal32 *b,
00052 const fpreal32 *c, int n) = 0;
00053 virtual void scalarOp(VM_SPUOp op,
00054 fpreal32 *d,
00055 const fpreal32 *a,
00056 const fpreal32 *b,
00057 fpreal32 c, int n) = 0;
00058 virtual void scalarOp(VM_SPUOp op,
00059 fpreal32 *d,
00060 const fpreal32 *a,
00061 fpreal32 b,
00062 fpreal32 c, int n) = 0;
00063 virtual fpreal32 dot(const fpreal32 *a,
00064 const fpreal32 *b, int n) = 0;
00065
00066 virtual void multVec(fpreal32 *result,
00067 const fpreal32 *v,
00068 const int32 *offsets,
00069 const void *cells,
00070 int bits, int nrows, int ncols) = 0;
00071 };
00072
00073 #endif