diff --git a/src/c/CudaMex.vcxproj b/src/c/CudaMex.vcxproj index d70e3a1cbcdea62a3af38757e39f226bf2855ada..64897e6e3be99cd3891b9c5362e294598d21b2dc 100644 --- a/src/c/CudaMex.vcxproj +++ b/src/c/CudaMex.vcxproj @@ -103,6 +103,7 @@ copy $(OutDir)CudaMex.dll "$(ProjectDir)Mex.mexw64"</Command> <ClInclude Include="mph\qualifier_helpers.h" /> <ClInclude Include="mph\tuple_helpers.h" /> <ClInclude Include="ScriptCmds\ArgConverter.h" /> + <ClInclude Include="ScriptCmds\Commands\ScrCmdCheckConfig.h" /> <ClInclude Include="ScriptCmds\Commands\ScrCmdClosure.h" /> <ClInclude Include="ScriptCmds\Commands\ScrCmdDeviceCount.h" /> <ClInclude Include="ScriptCmds\Commands\ScrCmdDeviceStats.h" /> diff --git a/src/c/CudaMex.vcxproj.filters b/src/c/CudaMex.vcxproj.filters index e7285431b74f8e2cb2a64ebd9a22dde046c94c46..37705fd3f42aff8e90629ae3e457e6145c3af833 100644 --- a/src/c/CudaMex.vcxproj.filters +++ b/src/c/CudaMex.vcxproj.filters @@ -159,6 +159,9 @@ <ClInclude Include="ScriptCmds\HydraConfig.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="ScriptCmds\Commands\ScrCmdCheckConfig.h"> + <Filter>Header Files\Commands</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <ClCompile Include="Mex\CudaMex.cpp"> diff --git a/src/c/CudaPy3DLL.vcxproj b/src/c/CudaPy3DLL.vcxproj index 6801ec4411cf58bca4cff8b32bd8c7a9c4adc89d..5a6065145d95a6ace37a46df68826a3e26fa7849 100644 --- a/src/c/CudaPy3DLL.vcxproj +++ b/src/c/CudaPy3DLL.vcxproj @@ -33,6 +33,7 @@ <ClInclude Include="Python\PyIncludes.h" /> <ClInclude Include="Python\PyTypes.h" /> <ClInclude Include="ScriptCmds\ArgConverter.h" /> + <ClInclude Include="ScriptCmds\Commands\ScrCmdCheckConfig.h" /> <ClInclude Include="ScriptCmds\Commands\ScrCmdClosure.h" /> <ClInclude Include="ScriptCmds\Commands\ScrCmdDeviceCount.h" /> <ClInclude Include="ScriptCmds\Commands\ScrCmdDeviceStats.h" /> diff --git a/src/c/CudaPy3DLL.vcxproj.filters b/src/c/CudaPy3DLL.vcxproj.filters index f8a085fc5cf566da22a556b93c94788dece66b23..5d1f3a160c326693e8efd18abb575cb786e22772 100644 --- a/src/c/CudaPy3DLL.vcxproj.filters +++ b/src/c/CudaPy3DLL.vcxproj.filters @@ -170,5 +170,8 @@ <ClInclude Include="ScriptCmds\HydraConfig.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="ScriptCmds\Commands\ScrCmdCheckConfig.h"> + <Filter>Header Files\Commands</Filter> + </ClInclude> </ItemGroup> -</Project> +</Project> \ No newline at end of file diff --git a/src/c/ScriptCmds/Commands/ScrCmdCheckConfig.h b/src/c/ScriptCmds/Commands/ScrCmdCheckConfig.h new file mode 100644 index 0000000000000000000000000000000000000000..b4546dfe55f9761d3a5e5dfc20ea73974d0a6025 --- /dev/null +++ b/src/c/ScriptCmds/Commands/ScrCmdCheckConfig.h @@ -0,0 +1,23 @@ +#pragma once + +#include "ScriptCommandImpl.h" +#include "ScriptCommandDefines.h" + +#include "HydraConfig.h" + +SCR_COMMAND_CLASSDEF(CheckConfig) +{ +public: + SCR_HELP_STRING("Get Hydra library configuration information.\n" + "Returns hydraConfig structure with configuration information.\n"); + + + static void execute(Script::ObjectType*& hydraConfig) + { + if ( !HydraConfig::validConfig() ) + Script::errorMsg("Hydra Library configuration was not initialized correctly!"); + + hydraConfig = Script::Struct::create(1, {"UseProcessMutex"}); + Script::Struct::setVal(hydraConfig, 0, "UseProcessMutex", Script::Converter::fromNumeric(HydraConfig::useProcessMutex())); + } +}; diff --git a/src/c/ScriptCmds/ScriptCommand.h b/src/c/ScriptCmds/ScriptCommand.h index 084fed702c82d7e4de6b871a7045c09718280b99..5fc68f989fb6904031924ec9c966ab8922dab99b 100644 --- a/src/c/ScriptCmds/ScriptCommand.h +++ b/src/c/ScriptCmds/ScriptCommand.h @@ -47,7 +47,6 @@ public: using CommandList = std::unordered_map<std::string, FuncPtrs>; - // TODO: Module initialization routines (and matlab dispatch) inline static const FuncPtrs* findCommand(const std::string& command) { if ( m_commands.count(command) < 1 ) diff --git a/src/c/ScriptCmds/ScriptCommandModule.h b/src/c/ScriptCmds/ScriptCommandModule.h index ac65959cfa8f2abd068d4cbfaa94346f9c75ac3b..66ede90574ab3a39aecb8597b20c7f9cfe262d4c 100644 --- a/src/c/ScriptCmds/ScriptCommandModule.h +++ b/src/c/ScriptCmds/ScriptCommandModule.h @@ -36,6 +36,9 @@ #include "Commands/ScrCmdDeviceCount.h" #include "Commands/ScrCmdDeviceStats.h" +// Debugging: Check Hydra library config from script +#include "Commands/ScrCmdCheckConfig.h" + // Cuda processing commands #include "Commands/ScrCmdClosure.h" #include "Commands/ScrCmdElementWiseDifference.h" diff --git a/src/c/ScriptCmds/ScriptCommands.h b/src/c/ScriptCmds/ScriptCommands.h index 0d9a10e15ecea814c92c6b24118073e7a3c3fc1f..9f12a1ee048131b44b5b940090a8cb6e7eceffd6 100644 --- a/src/c/ScriptCmds/ScriptCommands.h +++ b/src/c/ScriptCmds/ScriptCommands.h @@ -25,6 +25,8 @@ SCR_BEGIN_COMMANDS SCR_OUTPUT(SCR_STRUCT, memStats))) SCR_CMD_NOPROC(DeviceStats, SCR_PARAMS(SCR_OUTPUT(SCR_STRUCT, deviceStatsArray))) + SCR_CMD_NOPROC(CheckConfig, SCR_PARAMS(SCR_OUTPUT(SCR_STRUCT, hydraConfig))) + SCR_CMD(Closure, SCR_PARAMS ( SCR_INPUT(SCR_IMAGE(SCR_DYNAMIC), imageIn),