Guarantee wte Life F And c Effectivestudyformula bsearcho Life Digg Life tm Product l Formula u Formula o Guarantee Technorati RSS
Links to this post

CUDA integration with C#

0 comments
This article will focus on how to create an unmanaged dll with CUDA code and use it in a C# program. The example will show some differences between execution times of managed, unmanaged and new .NET 4 parallel versions of for() loops used to do computations on arrays.
I will show in brief how to configure CUDA environment and run example program. CUDA itself is out of scope for this article because of some great online documents, about which I have added links to. There will be a few words only regarding efficiency and execution speed of CUDA kernels and memory management.
CUDA enabled hardware and .NET 4 (Visual Studio 2010 IDE or C# Express 2010) is needed to successfully run the example code. Visual C++ Express 2008 has been used as a CUDA C editor (2010 version has changed custom build rules feature and cannot work with that provided by CUDA SDK for easy VS integration).
Part 1: Environment and tools configuration for CUDA
CUDA is a general purpose parallel computing architecture introduced by NVIDIA. CUDA programs (kernels) run on GPU instead of CPU for better performance (hundreds of cores that can collectively run thousands of computing threads). It comes with a software environment that allows developers to use C as a high-level programming language. This computation technology is used in mathematics, science, finance, modeling, image processing and so on.
Basic CUDA configuration for developing purpose:

  • Download and install CUDA toolkit for correct OS, use version 3.1 or latest 3.2RC or version 3.0 for device emulation (limited usage but works without CUDA enabled device, not supported after version 3.0)
  • Download and install SDK for the same OS and toolkit version
  • Update display drivers if you encounter problems with SDK installation

Visual C++ Express 2008 (or VS2008) configuration:
1. Syntax coloring

  • Open Tools -> Options from main window, then Text Editor -> File Extension, add .cu and .cuh extensions with Microsoft Visual C++ Editor
  • Copy file usertype.dat from [sdk dir]\C\doc\syntax_highlighting\visual_studio_8\ to Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ folder Restart Visual Studio

2. New project, 32bit Windows XP version
  • Default SDK location is c:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK\
  • Default toolkit location is C:\CUDA\
Create empty Win32 console application and add source file with .cu extension
Select newly created project in the Solution Explorer window and then right mouse key ï‚® Custom Build Rules, use Find Existing button to locate Cuda.rules file in [sdk dir] \C\common\ folder, add it and mark on the list of available rule files
Select again project -> Properties, select Release Configuration and then from the tree view:
- Configuration Properties -> Linker -> General -> Additional Library Directories:
add this line (default folders) C:\CUDA\lib;"C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\lib"
Configuration Properties -> Linker -> Input -> Additional Dependencies: cudart.lib
Use the same settings for Debug Configuration
For emulator configurations use Configuration Manager to add new configurations based on Release and Debug ones, name them as EMU-Release and EMU-Debug (or as you wish)

Read more: C# Corner
Posted via email from .NET Info
Delicious Twitter Facebook Digg Stumbleupon Technorati RSS
Links to this post

Cache Games - Bringing Access Based Cache Attacks on AES to Practice

0 comments
Abstract: Side channel attacks on cryptographic systems are attacks exploiting information gained from physical implementations rather than utilizing theoretical weaknesses of a scheme. In particular, during the last years, major achievements were made for the class of access-driven cache-attacks. The source of information leakage for such attacks are the locations of memory accesses performed by a victim process.
In this paper we analyze the case of AES and present an attack which is capable of recovering the full secret key in almost realtime for AES-128, requiring only a very limited number of observed encryptions. Unlike most other attacks, ours neither needs to know the ciphertext, nor does it need to know any information about the plaintext (such as its distribution, etc.). Moreover, for the first time we also show how the plaintext can be recovered without having access to the ciphertext. Further, our spy process can be run under an unprivileged user account. It is the first working attack for implementations using compressed tables, where it is not possible to find out the beginning of AES rounds any more -- a corner stone for all efficient previous attacks. All results of our attack have been demonstrated by a fully working implementation, and do not solely rely on theoretical considerations or simulations.
A contribution of probably independent interest is a denial of service attack on the scheduler of current Linux systems (CFS), which allows to monitor memory accesses with novelly high precision. Finally, we give some generalizations of our attack, and suggest some possible countermeasures which would render our attack impossible.

Read more: eprint
Posted via email from .NET Info
Delicious Twitter Facebook Digg Stumbleupon Technorati RSS
Links to this post

HowTo: Open MSTest with MSBuild

0 comments
According to the blogpost about „HowTo: build solutions with MSBuild“ I’m going to show you a little example about how to call MSTests.

Scenario
The structure is nearly the same like in this blogpost. As a little add-on I created a new test project:


I’ve added one more “RunTests” target to my BuildSolutions.target file where the MSBuild Script is included:

<Project xmlns="developer/msbuild/2003" DefaultTargets="Build">

<PropertyGroup>
<OutDir>$(MSBuildStartupDirectory)\OutDir\</OutDir>
<SolutionProperties>
OutDir=$(OutDir);
Platform=Any CPU;
Configuration=Release
</SolutionProperties>