diff --git a/src/NativeWrappers/.gitignore b/src/NativeWrappers/.gitignore new file mode 100644 index 00000000..48e14831 --- /dev/null +++ b/src/NativeWrappers/.gitignore @@ -0,0 +1,3 @@ +*.aps +Debug +Release \ No newline at end of file diff --git a/src/NativeWrappers/ATLAS/ATLASWrapper.vcproj b/src/NativeWrappers/ATLAS/ATLASWrapper.vcproj index b458064d..6211b5e8 100644 --- a/src/NativeWrappers/ATLAS/ATLASWrapper.vcproj +++ b/src/NativeWrappers/ATLAS/ATLASWrapper.vcproj @@ -19,7 +19,7 @@ Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1" + ConfigurationType="2" CharacterSet="2" > @@ -86,7 +92,7 @@ Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1" + ConfigurationType="2" CharacterSet="2" WholeProgramOptimization="1" > @@ -109,10 +115,13 @@ Name="VCCLCompilerTool" Optimization="2" EnableIntrinsicFunctions="true" - RuntimeLibrary="2" + AdditionalIncludeDirectories=""C:\source\mathnet-marcus\src\NativeWrappers\ATLAS";C:\cygwin\tmp\ATLAS\include" + PreprocessorDefinitions="_WINDOWS" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" WarningLevel="3" DebugInformationFormat="3" + CompileAs="0" /> + + + + + + + + diff --git a/src/NativeWrappers/ATLAS/blas.h b/src/NativeWrappers/ATLAS/blas.h new file mode 100644 index 00000000..90872d71 --- /dev/null +++ b/src/NativeWrappers/ATLAS/blas.h @@ -0,0 +1,4 @@ +#include "cblas.h" + +typedef struct { float real; float imag; } Complex8; +typedef struct { double real; double imag; } Complex16; diff --git a/src/NativeWrappers/Common/WindowsDLL.cpp b/src/NativeWrappers/Common/WindowsDLL.cpp new file mode 100644 index 00000000..3129eb35 --- /dev/null +++ b/src/NativeWrappers/Common/WindowsDLL.cpp @@ -0,0 +1,10 @@ +#ifdef _WINDOWS + #ifndef VC_EXTRALEAN + #define VC_EXTRALEAN + #endif + #include "windows.h" + + BOOL APIENTRY DllMain( HANDLE, DWORD, LPVOID ){ + return TRUE; + } +#endif diff --git a/src/NativeWrappers/Common/blas.c b/src/NativeWrappers/Common/blas.c new file mode 100644 index 00000000..8b0c2668 --- /dev/null +++ b/src/NativeWrappers/Common/blas.c @@ -0,0 +1,23 @@ +#include "blas.h" + +#ifdef _WINDOWS + #define DLLEXPORT __declspec( dllexport ) +#else + #define DLLEXPORT +#endif + +DLLEXPORT void s_axpy( const int n, const float alpha, const float x[], float y[]){ + cblas_saxpy(n, alpha, x, 1, y, 1); +} + +DLLEXPORT void d_axpy( const int n, const double alpha, const double x[], double y[]){ + cblas_daxpy(n, alpha, x, 1, y, 1); +} + +DLLEXPORT void c_axpy( const int n, const Complex8 alpha, const Complex8 x[], Complex8 y[]){ + cblas_caxpy(n, &alpha, x, 1, y, 1); +} + +DLLEXPORT void z_axpy( const int n, const Complex16 alpha, const Complex16 x[], Complex16 y[]){ + cblas_zaxpy(n, &alpha, x, 1, y, 1); +} diff --git a/src/NativeWrappers/Common/resource.h b/src/NativeWrappers/Common/resource.h new file mode 100644 index 00000000..27e2900c --- /dev/null +++ b/src/NativeWrappers/Common/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by resource.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/src/NativeWrappers/Common/resource.rc b/src/NativeWrappers/Common/resource.rc new file mode 100644 index 00000000..3f14db72 --- /dev/null +++ b/src/NativeWrappers/Common/resource.rc @@ -0,0 +1,103 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,2009,12,0 + PRODUCTVERSION 0,2009,12,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "http://mathdotnet.com" + VALUE "CompanyName", "Math.NET" + VALUE "FileDescription", "MathNET Numerics Native Library" + VALUE "FileVersion", "0.2009.12" + VALUE "InternalName", "Math.NET" + VALUE "LegalCopyright", "Copyright (C) Math.NET 2009" + VALUE "OriginalFilename", "MathNET.Numerics" + VALUE "ProductName", "Math.NET" + VALUE "ProductVersion", "2009.12" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/NativeWrappers/MKL/MKLWrapper.vcproj b/src/NativeWrappers/MKL/MKLWrapper.vcproj index f48cf97e..c1fa0a1b 100644 --- a/src/NativeWrappers/MKL/MKLWrapper.vcproj +++ b/src/NativeWrappers/MKL/MKLWrapper.vcproj @@ -19,7 +19,7 @@ Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1" + ConfigurationType="2" CharacterSet="2" > @@ -86,7 +92,7 @@ Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1" + ConfigurationType="2" CharacterSet="2" WholeProgramOptimization="1" > @@ -109,10 +115,13 @@ Name="VCCLCompilerTool" Optimization="2" EnableIntrinsicFunctions="true" - RuntimeLibrary="2" + AdditionalIncludeDirectories=""C:\source\mathnet-marcus\src\NativeWrappers\MKL";"C:\Program Files (x86)\Intel\Compiler\11.1\046\mkl\include"" + PreprocessorDefinitions="_WINDOWS" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" WarningLevel="3" DebugInformationFormat="3" + CompileAs="0" /> + + + + + + + + diff --git a/src/NativeWrappers/MKL/blas.h b/src/NativeWrappers/MKL/blas.h new file mode 100644 index 00000000..5e8eedb2 --- /dev/null +++ b/src/NativeWrappers/MKL/blas.h @@ -0,0 +1,4 @@ +#include "mkl_cblas.h" + +typedef MKL_Complex8 Complex8; +typedef MKL_Complex16 Complex16; \ No newline at end of file diff --git a/src/NativeWrappers/NativeWrappers.sln b/src/NativeWrappers/NativeWrappers.sln index cdcea157..6fbf6d0b 100644 --- a/src/NativeWrappers/NativeWrappers.sln +++ b/src/NativeWrappers/NativeWrappers.sln @@ -2,9 +2,17 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{5A0892FF-82CE-40FC-BCE1-73810C615F52}" + ProjectSection(SolutionItems) = preProject + Common\blas.c = Common\blas.c + Common\resource.h = Common\resource.h + Common\resource.rc = Common\resource.rc + Common\WindowsDLL.cpp = Common\WindowsDLL.cpp + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ATLASWrapper", "ATLAS\ATLASWrapper.vcproj", "{A848B8C9-E72A-4716-A8F1-04104CC2422F}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MKLWrapper", "MKL\MKLWrapper.vcproj", "{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -15,6 +23,10 @@ Global {A848B8C9-E72A-4716-A8F1-04104CC2422F}.Debug|Win32.Build.0 = Debug|Win32 {A848B8C9-E72A-4716-A8F1-04104CC2422F}.Release|Win32.ActiveCfg = Release|Win32 {A848B8C9-E72A-4716-A8F1-04104CC2422F}.Release|Win32.Build.0 = Release|Win32 + {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Debug|Win32.ActiveCfg = Debug|Win32 + {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Debug|Win32.Build.0 = Debug|Win32 + {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Win32.ActiveCfg = Release|Win32 + {C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE