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

MexIncludes/PyIncludes are now specifically include python/matlab headers...

MexIncludes/PyIncludes are now specifically include python/matlab headers ScriptIncludes.h is more general
parent ade9f6a4
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,7 @@
<ClInclude Include="WrapCmds\ScriptCommandImpl.h" />
<ClInclude Include="WrapCmds\ScriptHelpers.h" />
<ClInclude Include="WrapCmds\CommandList.h" />
<ClInclude Include="WrapCmds\ScriptIncludes.h" />
<ClInclude Include="WrapCmds\ScriptioMaps.h" />
<ClInclude Include="WrapCmds\ScriptTraits.h" />
<ClInclude Include="WrapCmds\ScriptTraitTfms.h" />
......
......@@ -89,6 +89,9 @@
<ClInclude Include="WrapCmds\ScriptCommandDefines.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="WrapCmds\ScriptIncludes.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
......
......@@ -2,5 +2,5 @@
#include <mex.h>
#define MEX_BUILD
#include "../WrapCmds/ScriptHelpers.h"
#include "../WrapCmds/ScriptCommand.h"
#pragma once
#include <mex.h>
#include "MexIncludes.h"
#include <cstddef>
#include <cstdint>
......
#pragma once
#define PY_BUILD
#include "../WrapCmds/ScriptHelpers.h"
#define PY_SSIZE_T_CLEAN
#include <Python.h>
// Make sure that Numpy symbols don't get re-imported in multiple compilation units
#ifndef NUMPY_IMPORT_MODULE
#define NO_IMPORT_ARRAY
#endif
#define PY_ARRAY_UNIQUE_SYMBOL HIP_ARRAY_API
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/arrayobject.h>
#include <py3c.h>
#undef snprintf
#pragma once
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "PyIncludes.h"
// Make sure that Numpy symbols don't get re-imported in multiple compilation units
#ifndef NUMPY_IMPORT_MODULE
#define NO_IMPORT_ARRAY
#endif
#define PY_ARRAY_UNIQUE_SYMBOL HIP_ARRAY_API
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/arrayobject.h>
#include <py3c.h>
#include <cstddef>
#include <cstdint>
......
#include <memory>
// This define forces inclusion of numpy symbols only in the hip_module.cpp file
#define NUMPY_IMPORT_MODULE
#include "PyIncludes.h"
#include "../WrapCmds/ScriptCommand.h"
#include "../WrapCmds/ScriptIncludes.h"
// Make this a unique pointer just in case init can be run more than once
static std::unique_ptr<PyMethodDef[]> hip_methods = nullptr;
......
......@@ -48,7 +48,7 @@
#if defined(PY_BUILD)
#define ARG_CONVERTER Script::PyArgConverter
#elif defined(MEXBUILD)
#elif defined(MEX_BUILD)
#define ARG_CONVERTER Script::MexArgConverter
#endif
......
#pragma once
#include <string>
#include <unordered_map>
#include "PyIncludes.h"
#include "ScriptIncludes.h"
// TODO: Put this in ifdef or py-specific includes
#define SCR_MODULE_NAME "HIP"
......
#pragma once
#if defined(PY_BUILD)
#include "../Python/PyIncludes.h"
#elif defined(MEX_BUILD)
#include "../Mex/MexIncludes.h"
#else
#error Either PY_BUILD or MEX_BUILD must be defined for project
#endif
#undef max
#undef min
#include "../WrapCmds/ScriptHelpers.h"
#include "../WrapCmds/ScriptCommand.h"
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