openclnet hinzugefügt
This commit is contained in:
Generated
+173
@@ -0,0 +1,173 @@
|
||||
namespace UnitTests
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.startToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.listBoxOutput = new System.Windows.Forms.ListBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.listBoxWarnings = new System.Windows.Forms.ListBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.listBoxErrors = new System.Windows.Forms.ListBox();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.testToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(685, 24);
|
||||
this.menuStrip1.TabIndex = 0;
|
||||
this.menuStrip1.Text = "menuStrip";
|
||||
//
|
||||
// testToolStripMenuItem
|
||||
//
|
||||
this.testToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.startToolStripMenuItem});
|
||||
this.testToolStripMenuItem.Name = "testToolStripMenuItem";
|
||||
this.testToolStripMenuItem.Size = new System.Drawing.Size(41, 20);
|
||||
this.testToolStripMenuItem.Text = "&Test";
|
||||
//
|
||||
// startToolStripMenuItem
|
||||
//
|
||||
this.startToolStripMenuItem.Name = "startToolStripMenuItem";
|
||||
this.startToolStripMenuItem.Size = new System.Drawing.Size(98, 22);
|
||||
this.startToolStripMenuItem.Text = "&Start";
|
||||
this.startToolStripMenuItem.Click += new System.EventHandler(this.startToolStripMenuItem_Click);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox1.Controls.Add(this.listBoxOutput);
|
||||
this.groupBox1.Location = new System.Drawing.Point(0, 27);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(685, 269);
|
||||
this.groupBox1.TabIndex = 4;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Output";
|
||||
//
|
||||
// listBoxOutput
|
||||
//
|
||||
this.listBoxOutput.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.listBoxOutput.FormattingEnabled = true;
|
||||
this.listBoxOutput.IntegralHeight = false;
|
||||
this.listBoxOutput.Location = new System.Drawing.Point(3, 16);
|
||||
this.listBoxOutput.Name = "listBoxOutput";
|
||||
this.listBoxOutput.Size = new System.Drawing.Size(679, 250);
|
||||
this.listBoxOutput.TabIndex = 2;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox2.Controls.Add(this.listBoxWarnings);
|
||||
this.groupBox2.Location = new System.Drawing.Point(0, 302);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(685, 121);
|
||||
this.groupBox2.TabIndex = 5;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Warnings";
|
||||
//
|
||||
// listBoxWarnings
|
||||
//
|
||||
this.listBoxWarnings.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.listBoxWarnings.FormattingEnabled = true;
|
||||
this.listBoxWarnings.IntegralHeight = false;
|
||||
this.listBoxWarnings.Location = new System.Drawing.Point(3, 16);
|
||||
this.listBoxWarnings.Name = "listBoxWarnings";
|
||||
this.listBoxWarnings.Size = new System.Drawing.Size(679, 102);
|
||||
this.listBoxWarnings.TabIndex = 3;
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox3.Controls.Add(this.listBoxErrors);
|
||||
this.groupBox3.Location = new System.Drawing.Point(0, 426);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(685, 111);
|
||||
this.groupBox3.TabIndex = 6;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Errors";
|
||||
//
|
||||
// listBoxErrors
|
||||
//
|
||||
this.listBoxErrors.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.listBoxErrors.FormattingEnabled = true;
|
||||
this.listBoxErrors.IntegralHeight = false;
|
||||
this.listBoxErrors.Location = new System.Drawing.Point(3, 16);
|
||||
this.listBoxErrors.Name = "listBoxErrors";
|
||||
this.listBoxErrors.Size = new System.Drawing.Size(679, 92);
|
||||
this.listBoxErrors.TabIndex = 4;
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(685, 537);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "Form1";
|
||||
this.Text = "Form1";
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem testToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem startToolStripMenuItem;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.ListBox listBoxOutput;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.ListBox listBoxWarnings;
|
||||
private System.Windows.Forms.ListBox listBoxErrors;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,555 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Olav Kalgraf(olav.kalgraf@gmail.com)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using OpenCLNet;
|
||||
|
||||
namespace UnitTests
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
Platform[] Platforms;
|
||||
Regex ParseOpenCLVersion = new Regex(@"OpenCL (?<MajorVersion>\d+)\.(?<MinorVersion>\d+).*");
|
||||
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void startToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
listBoxErrors.Items.Clear();
|
||||
listBoxWarnings.Items.Clear();
|
||||
listBoxOutput.Items.Clear();
|
||||
RunTests();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.ToString(), "Test terminated with a fatal exception.");
|
||||
}
|
||||
}
|
||||
|
||||
private void RunTests()
|
||||
{
|
||||
TestOpenCLClass();
|
||||
}
|
||||
|
||||
private void TestOpenCLClass()
|
||||
{
|
||||
if (OpenCL.NumberOfPlatforms <= 0)
|
||||
{
|
||||
listBoxOutput.Items.Add("OpenCL.NumberOfPlatforms=" + OpenCL.NumberOfPlatforms);
|
||||
throw new Exception("TestOpenCLClass: NumberOfPlatforms<0. Is the API available at all?");
|
||||
}
|
||||
|
||||
Platforms = OpenCL.GetPlatforms();
|
||||
if (Platforms.Length != OpenCL.NumberOfPlatforms)
|
||||
Error("OpenCL.NumberOfPlatforms!=Length of openCL.GetPlatforms()" + OpenCL.NumberOfPlatforms);
|
||||
|
||||
for (int platformIndex = 0; platformIndex < Platforms.Length; platformIndex++)
|
||||
{
|
||||
if (OpenCL.GetPlatform(platformIndex) != Platforms[platformIndex])
|
||||
Error("openCL.GetPlatform(platformIndex)!=Platforms[platformIndex]");
|
||||
|
||||
Output("Testing Platform " + platformIndex);
|
||||
TestPlatform(Platforms[platformIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
private void TestPlatform(Platform p)
|
||||
{
|
||||
Device[] allDevices;
|
||||
Device[] cpuDevices;
|
||||
Device[] gpuDevices;
|
||||
Device[] acceleratorDevices;
|
||||
|
||||
Output("Name: " + p.Name);
|
||||
Output("Vendor:" + p.Vendor);
|
||||
Output("Version:" + p.Version);
|
||||
|
||||
// Check format of version string
|
||||
Match m = ParseOpenCLVersion.Match(p.Version);
|
||||
if (!m.Success)
|
||||
Warning("Platform " + p.Name + " has an invalid version string");
|
||||
else
|
||||
{
|
||||
if (m.Groups["MajorVersion"].Value != "1" && m.Groups["MinorVersion"].Value != "0")
|
||||
Warning("Platform " + p.Name + " has a version number!=1.0(Not really a problem, but this test is written for 1.0)");
|
||||
}
|
||||
|
||||
// Check format of profile
|
||||
Output("Profile:" + p.Profile);
|
||||
if (p.Profile == "FULL_PROFILE" || p.Profile == "EMBEDDED_PROFILE")
|
||||
Output("Profile:" + p.Profile);
|
||||
else
|
||||
Warning("Platform " + p.Name + " has unknown profile "+p.Profile);
|
||||
|
||||
Output("Extensions: " + p.Extensions);
|
||||
|
||||
// Test whether number of devices is consistent
|
||||
allDevices = p.QueryDevices(DeviceType.ALL);
|
||||
if( allDevices.Length<=0 )
|
||||
Warning( "Platform "+p.Name+" has no devices" );
|
||||
|
||||
cpuDevices = p.QueryDevices(DeviceType.CPU);
|
||||
gpuDevices = p.QueryDevices(DeviceType.GPU);
|
||||
acceleratorDevices = p.QueryDevices(DeviceType.ACCELERATOR);
|
||||
if( allDevices.Length!=cpuDevices.Length+gpuDevices.Length+acceleratorDevices.Length )
|
||||
Warning( "QueryDevices( DeviceType.ALL ) return length inconsistent with sum of special purpose queries" );
|
||||
|
||||
// Create a few contexts and test them
|
||||
Output( "Testing Platform.CreateDefaultContext()" );
|
||||
using (Context c = p.CreateDefaultContext())
|
||||
{
|
||||
Output("Testing context"+c);
|
||||
TestContext(c);
|
||||
}
|
||||
Output("");
|
||||
Output("");
|
||||
|
||||
if (cpuDevices.Length > 0)
|
||||
{
|
||||
Output("Testing Platform.CreateContext()");
|
||||
using (Context c = p.CreateContext(null, cpuDevices, new ContextNotify(ContextNotifyFunc), (IntPtr)0x01234567))
|
||||
{
|
||||
Output("Testing context" + c);
|
||||
TestContext(c);
|
||||
}
|
||||
Output("");
|
||||
Output("");
|
||||
}
|
||||
|
||||
if (gpuDevices.Length > 0)
|
||||
{
|
||||
Output("Testing Platform.CreateContext()");
|
||||
using (Context c = p.CreateContext(null, gpuDevices, new ContextNotify(ContextNotifyFunc), (IntPtr)0x01234567))
|
||||
{
|
||||
Output("Testing context" + c);
|
||||
TestContext(c);
|
||||
}
|
||||
Output("");
|
||||
Output("");
|
||||
}
|
||||
|
||||
if (cpuDevices.Length > 0)
|
||||
{
|
||||
Output("Testing Platform.CreateContextFromType()");
|
||||
IntPtr[] contextProperties = new IntPtr[]
|
||||
{
|
||||
(IntPtr)ContextProperties.PLATFORM, p.PlatformID,
|
||||
IntPtr.Zero
|
||||
};
|
||||
using (Context c = p.CreateContextFromType(contextProperties, DeviceType.CPU, new ContextNotify(ContextNotifyFunc), (IntPtr)0x01234567))
|
||||
{
|
||||
Output("Testing context" + c);
|
||||
TestContext(c);
|
||||
}
|
||||
}
|
||||
|
||||
if (gpuDevices.Length > 0)
|
||||
{
|
||||
Output("Testing Platform.CreateContextFromType()");
|
||||
IntPtr[] contextProperties = new IntPtr[]
|
||||
{
|
||||
(IntPtr)ContextProperties.PLATFORM, p.PlatformID,
|
||||
IntPtr.Zero
|
||||
};
|
||||
using (Context c = p.CreateContextFromType(contextProperties, DeviceType.GPU, new ContextNotify(ContextNotifyFunc), (IntPtr)0x01234567))
|
||||
{
|
||||
Output("Testing context" + c);
|
||||
TestContext(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ContextNotifyFunc( string errInfo, byte[] privateInfo, IntPtr cb, IntPtr userData )
|
||||
{
|
||||
Error(errInfo);
|
||||
}
|
||||
|
||||
int NativeKernelCalled = 0;
|
||||
NativeKernel NativeKernelCallRef;
|
||||
|
||||
private void TestContext(Context c)
|
||||
{
|
||||
Device[] devices = c.Devices;
|
||||
OpenCLNet.Program p = c.CreateProgramFromFile("MemoryTests.cl");
|
||||
Dictionary<string, Kernel> kernelDictionary;
|
||||
|
||||
try
|
||||
{
|
||||
p.Build();
|
||||
}
|
||||
catch (OpenCLException ocle)
|
||||
{
|
||||
throw ocle;
|
||||
}
|
||||
kernelDictionary = p.CreateKernelDictionary();
|
||||
NativeKernelCallRef = new NativeKernel(NativeKernelTest);
|
||||
for (int deviceIndex = 0; deviceIndex < devices.Length; deviceIndex++)
|
||||
{
|
||||
Device d;
|
||||
|
||||
d = devices[deviceIndex];
|
||||
using (CommandQueue cq = c.CreateCommandQueue(d))
|
||||
{
|
||||
if ( (d.ExecutionCapabilities & (ulong)DeviceExecCapabilities.NATIVE_KERNEL)!=0 )
|
||||
{
|
||||
Output("Testing native kernel execution");
|
||||
cq.EnqueueNativeKernel(NativeKernelCallRef);
|
||||
cq.EnqueueBarrier();
|
||||
if (NativeKernelCalled != 1)
|
||||
Error("EnqueueNativeKernel failed");
|
||||
Interlocked.Decrement(ref NativeKernelCalled);
|
||||
}
|
||||
else
|
||||
{
|
||||
Output("Testing native kernel execution: Not supported");
|
||||
}
|
||||
|
||||
TestMem(c, cq, kernelDictionary);
|
||||
TestDevice(d);
|
||||
TestCommandQueue(c, cq);
|
||||
TestKernel(c, cq, kernelDictionary["ArgIO"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void NativeKernelTest(IntPtr args)
|
||||
{
|
||||
Interlocked.Increment(ref NativeKernelCalled);
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1)]
|
||||
internal struct IOKernelArgs
|
||||
{
|
||||
internal long outLong;
|
||||
internal int outInt;
|
||||
internal float outSingle;
|
||||
internal IntPtr outIntPtr;
|
||||
}
|
||||
|
||||
private unsafe void TestKernel(Context c, CommandQueue cq, Kernel argIOKernel)
|
||||
{
|
||||
Mem outArgBuffer = c.CreateBuffer(MemFlags.WRITE_ONLY, sizeof(IOKernelArgs), IntPtr.Zero);
|
||||
|
||||
Output("Testing kernel - Argument return");
|
||||
|
||||
argIOKernel.SetIntArg(0, 1);
|
||||
argIOKernel.SetLongArg(1, 65);
|
||||
argIOKernel.SetSingleArg(2, 38.4f);
|
||||
argIOKernel.SetIntPtrArg(3, new IntPtr(0x01234567));
|
||||
argIOKernel.SetIntPtrArg(4, outArgBuffer.MemID);
|
||||
|
||||
cq.EnqueueTask(argIOKernel);
|
||||
|
||||
IntPtr outArgPtr = cq.EnqueueMapBuffer( outArgBuffer, true, MapFlags.READ, IntPtr.Zero, (IntPtr)sizeof(IOKernelArgs) );
|
||||
IOKernelArgs args = (IOKernelArgs)Marshal.PtrToStructure(outArgPtr, typeof(IOKernelArgs));
|
||||
cq.EnqueueUnmapMemObject(outArgBuffer, outArgPtr);
|
||||
|
||||
if (args.outInt != 1)
|
||||
Error("argIOKernel failed to return correct arguments");
|
||||
if (args.outLong != 65)
|
||||
Error("argIOKernel failed to return correct arguments");
|
||||
if (args.outSingle != 38.4f)
|
||||
Error("argIOKernel failed to return correct arguments");
|
||||
if (args.outIntPtr != new IntPtr(0x01234567))
|
||||
Error("argIOKernel failed to return correct arguments");
|
||||
}
|
||||
|
||||
private void TestMem(Context c, CommandQueue cq, Dictionary<string, Kernel> kernelDictionary )
|
||||
{
|
||||
long size = 8192;
|
||||
|
||||
Output( "Testing Mem class" );
|
||||
Output( "Allocating "+size+" bytes of READ_WRITE memory" );
|
||||
using (Mem buffer = c.CreateBuffer(MemFlags.READ_WRITE, size, IntPtr.Zero))
|
||||
{
|
||||
Output("Mem.MemSize=" + size);
|
||||
if (buffer.MemSize.ToInt64() != size)
|
||||
Error("Mem.Size!=input size");
|
||||
Output("Mem.MemType=" + buffer.MemType);
|
||||
if (buffer.MemType != MemObjectType.BUFFER)
|
||||
Error("Mem.MemType!=MemObjectType.BUFFER");
|
||||
|
||||
Output("Mem.MapCount=" + buffer.MapCount);
|
||||
if (buffer.MapCount != 0)
|
||||
Error("Mem.MapCount!=0");
|
||||
|
||||
Kernel k = kernelDictionary["TestReadWriteMemory"];
|
||||
k.SetArg(0, buffer);
|
||||
k.SetArg(1, (IntPtr)size);
|
||||
cq.EnqueueTask(k);
|
||||
cq.EnqueueBarrier();
|
||||
}
|
||||
|
||||
Output("Allocating " + size + " bytes of READ memory");
|
||||
using (Mem buffer = c.CreateBuffer(MemFlags.READ_ONLY, size, IntPtr.Zero))
|
||||
{
|
||||
Output("Mem.MemSize=" + size);
|
||||
if (buffer.MemSize.ToInt64() != size)
|
||||
Error("Mem.Size!=input size");
|
||||
Output("Mem.MemType=" + buffer.MemType);
|
||||
if (buffer.MemType != MemObjectType.BUFFER)
|
||||
Error("Mem.MemType!=MemObjectType.BUFFER");
|
||||
|
||||
Output("Mem.MapCount=" + buffer.MapCount);
|
||||
if (buffer.MapCount != 0)
|
||||
Error("Mem.MapCount!=0");
|
||||
|
||||
Kernel k = kernelDictionary["TestReadMemory"];
|
||||
k.SetArg(0, buffer);
|
||||
k.SetArg(1, (IntPtr)size);
|
||||
cq.EnqueueTask(k);
|
||||
cq.EnqueueBarrier();
|
||||
}
|
||||
|
||||
Output("Allocating " + size + " bytes of WRITE memory");
|
||||
using (Mem buffer = c.CreateBuffer(MemFlags.WRITE_ONLY, size, IntPtr.Zero))
|
||||
{
|
||||
Output("Mem.MemSize=" + size);
|
||||
if (buffer.MemSize.ToInt64() != size)
|
||||
Error("Mem.Size!=input size");
|
||||
Output("Mem.MemType=" + buffer.MemType);
|
||||
if (buffer.MemType != MemObjectType.BUFFER)
|
||||
Error("Mem.MemType!=MemObjectType.BUFFER");
|
||||
|
||||
Output("Mem.MapCount=" + buffer.MapCount);
|
||||
if (buffer.MapCount != 0)
|
||||
Error("Mem.MapCount!=0");
|
||||
|
||||
Kernel k = kernelDictionary["TestWriteMemory"];
|
||||
k.SetArg(0, buffer);
|
||||
k.SetArg(1, (IntPtr)size);
|
||||
cq.EnqueueTask(k);
|
||||
cq.EnqueueBarrier();
|
||||
}
|
||||
}
|
||||
|
||||
private void TestDevice( Device d )
|
||||
{
|
||||
Output("Testing device: " + d.Name);
|
||||
// d.ToString() is overloaded to output all properties as a string, so every property will be used that way
|
||||
Output(d.ToString());
|
||||
}
|
||||
|
||||
private void TestCommandQueue(Context c, CommandQueue cq )
|
||||
{
|
||||
string programName = @"MemoryTests.cl";
|
||||
|
||||
Output("Testing compilation of: " + programName);
|
||||
OpenCLNet.Program p0 = c.CreateProgramWithSource(File.ReadAllLines(programName));
|
||||
OpenCLNet.Program p = c.CreateProgramWithSource(File.ReadAllText(programName));
|
||||
p0.Build();
|
||||
p.Build();
|
||||
Kernel k = p.CreateKernel(@"LoopAndDoNothing");
|
||||
|
||||
TestCommandQueueMemCopy(c, cq);
|
||||
TestCommandQueueAsync(c, cq, k );
|
||||
}
|
||||
|
||||
#region TestCommandQueue helper functions
|
||||
|
||||
private void TestCommandQueueAsync(Context c, CommandQueue cq, Kernel kernel )
|
||||
{
|
||||
List<Event> events = new List<Event>();
|
||||
Event clEvent;
|
||||
|
||||
Output("Testing asynchronous task issuing (clEnqueueTask) and waiting for events");
|
||||
|
||||
// Issue a bunch of slow operations
|
||||
kernel.SetArg(0, 5000000);
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
cq.EnqueueTask(kernel, 0, null, out clEvent);
|
||||
events.Add(clEvent);
|
||||
}
|
||||
|
||||
// Issue a bunch of fast operations
|
||||
kernel.SetArg(0, 500);
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
cq.EnqueueTask(kernel, 0, null, out clEvent);
|
||||
events.Add(clEvent);
|
||||
}
|
||||
|
||||
Event[] eventList = events.ToArray();
|
||||
cq.EnqueueWaitForEvents(eventList.Length, eventList);
|
||||
while (events.Count > 0)
|
||||
{
|
||||
events[0].Dispose();
|
||||
events.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
|
||||
private void TestCommandQueueMemCopy(Context c, CommandQueue cq)
|
||||
{
|
||||
AlignedArrayFloat aafSrc = new AlignedArrayFloat(1024 * 1024, 64);
|
||||
AlignedArrayFloat aafDst = new AlignedArrayFloat(1024 * 1024, 64);
|
||||
|
||||
SetAAF(aafSrc, 0.0f);
|
||||
SetAAF(aafDst, 1.0f);
|
||||
|
||||
/// Test HOST_PTR -> HOST_PTR copy
|
||||
/// The call to EnqueueMapBuffer synchronizes caches before testing the result
|
||||
Output("Testing synchronous host memory->memory copy(clEnqueueCopyBuffer)");
|
||||
using (Mem memSrc = c.CreateBuffer(MemFlags.USE_HOST_PTR, aafSrc.ByteLength, aafSrc))
|
||||
{
|
||||
using (Mem memDst = c.CreateBuffer(MemFlags.USE_HOST_PTR, aafDst.ByteLength, aafDst))
|
||||
{
|
||||
cq.EnqueueCopyBuffer(memSrc, memDst, IntPtr.Zero, IntPtr.Zero, (IntPtr)aafSrc.ByteLength);
|
||||
cq.EnqueueBarrier();
|
||||
IntPtr mappedPtr = cq.EnqueueMapBuffer(memDst, true, MapFlags.READ, (IntPtr)0, (IntPtr)aafDst.ByteLength);
|
||||
if (!TestAAF(aafDst, 0.0f))
|
||||
Error("EnqueueCopyBuffer failed, destination is invalid");
|
||||
cq.EnqueueUnmapMemObject(memDst, mappedPtr);
|
||||
cq.EnqueueBarrier();
|
||||
}
|
||||
}
|
||||
|
||||
/// Test COPY_HOST_PTR -> COPY_HOST_PTR copy
|
||||
/// Verify that original source buffers are intact and that the copy was successful
|
||||
Output("Testing synchronous host memory->memory copy(clEnqueueCopyBuffer)");
|
||||
SetAAF(aafSrc, 0.0f);
|
||||
SetAAF(aafDst, 1.0f);
|
||||
using (Mem memSrc = c.CreateBuffer(MemFlags.COPY_HOST_PTR, aafSrc.ByteLength, aafSrc))
|
||||
{
|
||||
using (Mem memDst = c.CreateBuffer(MemFlags.COPY_HOST_PTR, aafSrc.ByteLength, aafDst))
|
||||
{
|
||||
SetAAF(aafSrc, 2.0f);
|
||||
SetAAF(aafDst, 3.0f);
|
||||
|
||||
cq.EnqueueCopyBuffer(memSrc, memDst, IntPtr.Zero, IntPtr.Zero, (IntPtr)aafSrc.ByteLength);
|
||||
cq.Finish();
|
||||
|
||||
if (!TestAAF(aafSrc, 2.0f))
|
||||
Error("Memory copy destroyed src buffer");
|
||||
if (!TestAAF(aafDst, 3.0f))
|
||||
Error("Memory copy destroyed dst buffer");
|
||||
|
||||
cq.EnqueueReadBuffer(memDst, true, IntPtr.Zero, (IntPtr)aafDst.ByteLength, aafDst);
|
||||
cq.Finish();
|
||||
if (!TestAAF(aafDst, 0.0f))
|
||||
Error("Memory copy failed");
|
||||
}
|
||||
}
|
||||
|
||||
/// Test ALLOC_HOST_PTR -> ALLOC_HOST_PTR copy
|
||||
Output("Testing synchronous host memory->memory copy(clEnqueueCopyBuffer)");
|
||||
SetAAF(aafSrc, 0.0f);
|
||||
SetAAF(aafDst, 1.0f);
|
||||
using (Mem memSrc = c.CreateBuffer((MemFlags)((ulong)MemFlags.ALLOC_HOST_PTR + (ulong)MemFlags.READ_WRITE), aafSrc.ByteLength, IntPtr.Zero))
|
||||
{
|
||||
using (Mem memDst = c.CreateBuffer((MemFlags)((ulong)MemFlags.ALLOC_HOST_PTR + (ulong)MemFlags.WRITE_ONLY), aafSrc.ByteLength, IntPtr.Zero))
|
||||
{
|
||||
cq.EnqueueWriteBuffer(memSrc, false, (IntPtr)0, (IntPtr)aafSrc.ByteLength, aafSrc);
|
||||
cq.EnqueueWriteBuffer(memDst, false, (IntPtr)0, (IntPtr)aafSrc.ByteLength, aafSrc);
|
||||
cq.EnqueueBarrier();
|
||||
|
||||
cq.EnqueueCopyBuffer(memSrc, memDst, IntPtr.Zero, IntPtr.Zero, (IntPtr)aafSrc.ByteLength);
|
||||
cq.EnqueueBarrier();
|
||||
|
||||
cq.EnqueueReadBuffer(memDst, true, IntPtr.Zero, (IntPtr)aafDst.ByteLength, aafDst);
|
||||
if (!TestAAF(aafDst, 0.0f))
|
||||
Error("Memory copy failed");
|
||||
}
|
||||
}
|
||||
|
||||
/// Test DEFAULT -> DEFAULT copy
|
||||
Output("Testing synchronous host memory->memory copy(clEnqueueCopyBuffer)");
|
||||
SetAAF(aafSrc, 0.0f);
|
||||
SetAAF(aafDst, 1.0f);
|
||||
using (Mem memSrc = c.CreateBuffer((MemFlags)((ulong)MemFlags.ALLOC_HOST_PTR + (ulong)MemFlags.READ_ONLY), aafSrc.ByteLength, IntPtr.Zero))
|
||||
{
|
||||
using (Mem memDst = c.CreateBuffer((MemFlags)((ulong)MemFlags.ALLOC_HOST_PTR + (ulong)MemFlags.WRITE_ONLY), aafSrc.ByteLength, IntPtr.Zero))
|
||||
{
|
||||
cq.EnqueueWriteBuffer(memSrc, false, (IntPtr)0, (IntPtr)aafSrc.ByteLength, aafSrc);
|
||||
cq.EnqueueWriteBuffer(memDst, false, (IntPtr)0, (IntPtr)aafSrc.ByteLength, aafSrc);
|
||||
cq.EnqueueBarrier();
|
||||
|
||||
cq.EnqueueCopyBuffer(memSrc, memDst, IntPtr.Zero, IntPtr.Zero, (IntPtr)aafSrc.ByteLength);
|
||||
cq.EnqueueBarrier();
|
||||
|
||||
cq.EnqueueReadBuffer(memDst, true, IntPtr.Zero, (IntPtr)aafDst.ByteLength, aafDst);
|
||||
if (!TestAAF(aafDst, 0.0f))
|
||||
Error("Memory copy failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool TestAAF(AlignedArrayFloat aaf, float c)
|
||||
{
|
||||
for (int i = 0; i < aaf.Length; i++)
|
||||
if (aaf[i] != c)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private void SetAAF(AlignedArrayFloat aaf, float c)
|
||||
{
|
||||
for (int i = 0; i < aaf.Length; i++)
|
||||
aaf[i] = c;
|
||||
}
|
||||
|
||||
private void SetAAFLinear(AlignedArrayFloat aaf)
|
||||
{
|
||||
for (int i = 0; i < aaf.Length; i++)
|
||||
aaf[i] = (float)i;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void Output(string s)
|
||||
{
|
||||
listBoxOutput.Items.Add(s);
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
private void Warning(string s)
|
||||
{
|
||||
listBoxWarnings.Items.Add(s);
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
private void Error(string s)
|
||||
{
|
||||
listBoxErrors.Items.Add(s);
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Olav Kalgraf(olav.kalgraf@gmail.com)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
__constant uint Palette[17][4] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0xFF },
|
||||
{ 0x00, 0xA8, 0x76, 0xFF },
|
||||
{ 0x20, 0x7E, 0x62, 0xFF },
|
||||
{ 0x00, 0x6D, 0x4C, 0xFF },
|
||||
{ 0x35, 0xD4, 0xA4, 0xFF },
|
||||
{ 0x5F, 0xD4, 0xB1, 0xFF },
|
||||
{ 0x0D, 0x56, 0xA6, 0xFF },
|
||||
{ 0x27, 0x4F, 0x7D, 0xFF },
|
||||
{ 0x04, 0x35, 0x6C, 0xFF },
|
||||
{ 0x41, 0x86, 0xD3, 0xFF },
|
||||
{ 0x68, 0x9A, 0xD3, 0xFF },
|
||||
{ 0x4D, 0xDE, 0x00, 0xFF },
|
||||
{ 0x55, 0xA6, 0x2A, 0xFF },
|
||||
{ 0x32, 0x90, 0x00, 0xFF },
|
||||
{ 0x7A, 0xEE, 0x3C, 0xFF },
|
||||
{ 0x99, 0xEE, 0x6B, 0xFF },
|
||||
{ 0x99, 0xEE, 0x6B, 0xFF },
|
||||
/*
|
||||
{0x00, 0x00, 0x5a, 0xff,},
|
||||
{0x39, 0x8c, 0xdb, 0xff,},
|
||||
{0x9b, 0xb9, 0xff, 0xff,},
|
||||
{0x4a, 0xae, 0x92, 0xff,},
|
||||
{0x4a, 0xae, 0x92, 0xff,},*/
|
||||
};
|
||||
|
||||
#define MAXITER 100
|
||||
#define PALETTELENGTH 16
|
||||
|
||||
__constant int8 i8_01234567 = (int8)( 0, 1, 2, 3, 4, 5, 6, 7 );
|
||||
__constant int8 i8_00000000 = (int8)( 0, 1, 2, 3, 4, 5, 6, 7 );
|
||||
__constant int8 i8_11111111 = (int8)( 0, 1, 2, 3, 4, 5, 6, 7 );
|
||||
|
||||
__kernel void Mandelbrot( float left, float top, float right, float bottom, int stride, __global uchar4* pOutput )
|
||||
{
|
||||
size_t width = get_global_size(0);
|
||||
size_t height = get_global_size(1);
|
||||
size_t cx = get_global_id(0);
|
||||
size_t cy = get_global_id(1);
|
||||
float dx = (right-left)/(float)width;
|
||||
float dy = (bottom-top)/(float)height;
|
||||
|
||||
float x0 = left+dx*(float)cx;
|
||||
float y0 = top+dy*(float)cy;
|
||||
float x = 0.0f;
|
||||
float y = 0.0f;
|
||||
int iteration = 0;
|
||||
int max_iteration = MAXITER;
|
||||
|
||||
while( x*x-y*y<=(2*2) && iteration<max_iteration )
|
||||
{
|
||||
float xtemp = x*x-y*y+x0;
|
||||
y = 2*x*y+y0;
|
||||
x = xtemp;
|
||||
iteration++;
|
||||
}
|
||||
int index;
|
||||
index = iteration*PALETTELENGTH/MAXITER;
|
||||
//index = iteration%PALETTELENGTH;
|
||||
float4 color0 = (float4)(Palette[index][0],Palette[index][1],Palette[index][2],Palette[index][3]);
|
||||
float4 color1 = (float4)(Palette[index+1][0],Palette[index+1][1],Palette[index+1][2],Palette[index+1][3]);
|
||||
float mixFactor = clamp( (iteration%(MAXITER/PALETTELENGTH))/(float)(MAXITER/PALETTELENGTH), 0.0f, 1.0f);
|
||||
float4 mixFactors = (float4)(1.0f-mixFactor, 1.0f-mixFactor, 1.0f-mixFactor, 1.0f);
|
||||
float4 mixfc = mix( color0, color1, mixFactors );
|
||||
mixfc = color0*mixFactors+color1*((float4)(1.0f)-mixFactors);
|
||||
pOutput[width*cy+cx] = convert_uchar4( mixfc );
|
||||
}
|
||||
|
||||
#if 0
|
||||
__kernel void MandelbrotVectorized( float left, float top, float right, float bottom, int stride, __global uchar4* pOutput )
|
||||
{
|
||||
size_t width = get_global_size(0);
|
||||
size_t height = get_global_size(1);
|
||||
size_t cx = get_global_id(0);
|
||||
size_t cy = get_global_id(1);
|
||||
float dx = (right-left)/(float)width;
|
||||
float dy = (bottom-top)/(float)height;
|
||||
|
||||
float8 dxs = (float8)(dxs)*i8_01234567;
|
||||
int8 cxs = (int8)(cx)*(int8)(8)+i8_01234567;
|
||||
float8 x0s = (float8)(left)+(float8)(cx)+dxs;
|
||||
float8 xs = i8_00000000;
|
||||
float8 ys = i8_00000000;
|
||||
|
||||
float x0 = left+dx*(float)cx;
|
||||
float y0 = top+dy*(float)cy;
|
||||
float x = 0.0f;
|
||||
float y = 0.0f;
|
||||
int8 iterations = (int8)(0);
|
||||
int8 max_iterations = (int8)(255);
|
||||
|
||||
loop:
|
||||
float8 doneflags = (float8)(0);
|
||||
float8 looptest = (xs*xs-ys*ys)<=(float8)(2*2);
|
||||
doneflags |= ~loopTest;
|
||||
|
||||
if( !any( (xs*xs-ys*ys)<=(float8)(2*2) ) && all( iterations<max_iterations ) )
|
||||
goto done;
|
||||
|
||||
float8 xtemp = xs*xs-ys*ys+x0s;
|
||||
float8 ytemp = 2*xs*ys+y0s;
|
||||
xs = select( xs, xtemp, doneflags );
|
||||
ys = select( ys, ytemp, doneflags );
|
||||
|
||||
iterations = select( iterations, iterations+i8_11111111, doneflags );
|
||||
goto loop;
|
||||
|
||||
done:
|
||||
|
||||
int index;
|
||||
color = iteration==max_iteration?0.0f: (float)iteration/255.0f;
|
||||
index = clamp( iteration, 0.0f, 255.0f )/64;
|
||||
pOutput[width*cy+cx] = (uchar4)(Palette[index][0],Palette[index][1],Palette[index][2],Palette[index][3]);
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Olav Kalgraf(olav.kalgraf@gmail.com)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable
|
||||
|
||||
constant char TestMemory[] = "TestMemory";
|
||||
|
||||
kernel void MemoryCopy( global float* pSrc, global float* pDst, size_t length )
|
||||
{
|
||||
global float* pEnd;
|
||||
|
||||
pEnd = pSrc+length;
|
||||
while( pSrc<pEnd )
|
||||
*pDst++ = *pSrc++;
|
||||
}
|
||||
|
||||
kernel void LoopAndDoNothing( int iterations )
|
||||
{
|
||||
for( int i=0; i<iterations; i++ )
|
||||
;
|
||||
}
|
||||
|
||||
struct IOKernelArgs
|
||||
{
|
||||
long outLong;
|
||||
int outInt;
|
||||
float outSingle;
|
||||
intptr_t outIntPtr;
|
||||
};
|
||||
|
||||
kernel void ArgIO( int i,
|
||||
long l,
|
||||
float s,
|
||||
intptr_t p,
|
||||
global struct IOKernelArgs* pA)
|
||||
{
|
||||
pA->outInt = i;
|
||||
pA->outLong = l;
|
||||
pA->outSingle = s;
|
||||
pA->outIntPtr = p;
|
||||
}
|
||||
|
||||
kernel void TestReadMemory( global char* pData, size_t length )
|
||||
{
|
||||
int sum;
|
||||
|
||||
for( size_t i=0; i<length; i++ )
|
||||
sum += pData[i];
|
||||
}
|
||||
|
||||
kernel void TestWriteMemory( global char* pData, size_t length )
|
||||
{
|
||||
for( size_t i=0; i<length; i++ )
|
||||
pData[i] = 1;
|
||||
}
|
||||
|
||||
kernel void TestReadWriteMemory( global char* pData, size_t length )
|
||||
{
|
||||
for( size_t i=0; i<length; i++ )
|
||||
pData[length-1-i] = pData[i];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace UnitTests
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("UnitTests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("UnitTests")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("943b1a5e-83e4-42f1-8187-a852dc5ef2a4")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace UnitTests.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UnitTests.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace UnitTests.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{264E13EF-4308-4033-96C1-54C13C82D7C0}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>UnitTests</RootNamespace>
|
||||
<AssemblyName>UnitTests</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="MemoryTests.cl">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Mandelbrot.cl">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenCLNet\OpenCLNet.csproj">
|
||||
<Project>{758285C6-1ACA-458A-9906-EE6701D5AF87}</Project>
|
||||
<Name>OpenCLNet</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PublishUrlHistory />
|
||||
<InstallUrlHistory />
|
||||
<SupportUrlHistory />
|
||||
<UpdateUrlHistory />
|
||||
<BootstrapperUrlHistory />
|
||||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>en-US</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user