Skip to content
Snippets Groups Projects
Commit 6b48b06d authored by Mark Winter's avatar Mark Winter
Browse files

Minor fixes and correct throw on image type

parent 22ddc083
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ static struct PyModuleDef hip_moduledef =
};
// Main module initialization entry point
// Main python module initialization entry point
MODULE_INIT_FUNC(HIP)
{
ScriptCommand::CommandList cmds = ScriptCommand::commands();
......
......@@ -111,7 +111,7 @@ namespace Script
static Script::ObjectType* store_out(const std::tuple<ScrOuts...>& outputs)
{
static_assert(sizeof... (ScrOuts) == 0, "HIP_COMPILE: Output argument selector size mismatch");
return Py_None;
Py_RETURN_NONE;
}
};
......
......@@ -7,19 +7,27 @@
// TODO: Put this in ifdef or py-specific includes
#define SCR_MODULE_NAME "HIP"
#define SCR_DISPATCH_FUNC_DECL(TypeName) PyObject* TypeName(PyObject* self, PyObject* args)
#define SCR_USAGE_FUNC_DECL(TypeName) std::string TypeName()
#define SCR_HELP_FUNC_DECL(TypeName) std::string TypeName()
#define SCR_INFO_FUNC_DECL(TypeName) void TypeName(std::string& command, std::string& help, std::string& outArgs, std::string& inArgs)
#define SCR_DISPATCH_FUNC_DEF(Name) \
SCR_DISPATCH_FUNC_DECL(dispatch) \
{ \
PyObject* output = nullptr; \
convert_dispatch(output, args); \
return output; \
}
#if defined(PY_BUILD)
#define SCR_DISPATCH_FUNC_DECL(TypeName) PyObject* TypeName(PyObject* self, PyObject* args)
#define SCR_DISPATCH_FUNC_DEF(Name) \
SCR_DISPATCH_FUNC_DECL(dispatch) \
{ \
PyObject* output = nullptr; \
convert_dispatch(output, args); \
return output; \
}
#elif defined(MEX_BUILD)
#define SCR_DISPATCH_FUNC_DECL(TypeName) void TypeName(int nlhs,mxArray* plhs[],int nrhs,const mxArray* prhs[])
#define SCR_DISPATCH_FUNC_DEF(Name) \
SCR_DISPATCH_FUNC_DECL(dispatch) \
{ \
convert_dispatch(nlhs,plhs, nrhs,prhs); \
}
#endif
class ScriptCommand
{
......
......@@ -220,8 +220,7 @@ private:
}
else
{
// TODO: Throw type-error here
return;
throw ArgError("Image type unsupported (%x)", type);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment