Cuda Grids, Blocks and Threads – A Little Utility

Initially one of the things that can be very confusing when learning CUDA is the whole Grid, Block and Thread parcelling up of the work. Even though I am soon to be giving a talk about CUDA, I suddenly discovered today that my understanding of it was a bit wrong.

In order to see what was happening under the hood I wrote a simple CUDA utility program that would help me understand grids, blocks and threads when used with a simple one dimensional array.
Continue reading

Posted in CUDA, GPU | Leave a comment

GPU Programming Talk – A Little Sneak Preview

Wow, its been over a year since I last posted to my blog. I have been so busy and doing so many ‘important’ things, I have forgotten to do any fun things!

That’s all changing now as I am preparing a talk about GPU programming and I thought I would share a sneak peek with you of one of the things I will be showing.

Below are two images from a program that attempts to simulate galaxy creation. The simulation runs in real-time on the GPU of my macbook pro ( yes a laptop ) and has half a million particles interacting gravitationally. The different types of ‘galaxy’ are produced by small changes to the initial conditions.

If you want to find out how it’s done come to my talk.

http://www.reasonstobecreative.com/speakers/index.php?id=conradwinchester

http://www.lfpug.com/30th-august-2012-30082012/

 

A Bar Spiral (almost)

Galaxy Simulation 1 Results

A more chaotic spiral

Posted in CUDA, GPU | Leave a comment

Making a Maven Out Of A Molehill Update 1

The molehill enabled Flex SDK available on Flashnexus has now been updated to the latests incubator version 11.0.1.3d, latest playerglobal release 051211 and the official stable flex 4.5 release 4.5.0.20967.

In order to use this SDK you need to add the following maven repository to either your .m2/settings.xml file or putting in directly in your pom of choice.

				      
<repository>
  <id>flash-nexus-repository</id>
  <url>http://www.flashnexus.org/nexus/content/groups/public</url>
</repository>

Then you will be able to access the SDK from your pom.

The Pom File

As normal you will be able to use this SDK adding the following SDK dependency to your project pom, specifying the version as 4.5.0.20967-MOLEHILL-051211.

<dependencies>
  <dependency>
     <groupId>com.adobe.flex.framework</groupId>
     <artifactId>flex-framework</artifactId>
     <version>4.5.0.20967-MOLEHILL-051211</version>
     <type>pom</type>
  </dependency>
</dependencies>

However the POM file needs a few extra bits added to work properly with the incubator flash player. You must use the beta 7 of Flex mojos for the build because this understands the swfVersion configuration parameter for the build. Then you must set the SWF version to 13 and target flash player 11.0.0. So you need to have the following in the configuration of your build at least

<build>
  <sourceDirectory>src</sourceDirectory>
  <plugins>
    <plugin>
      <groupId>org.sonatype.flexmojos</groupId>
      <artifactId>flexmojos-maven-plugin</artifactId>
      <version>4.0-beta-7</version>
      <extensions>true</extensions>
      <configuration>
        <sourceFile>{source you want to compile}</sourceFile>
        <targetPlayer>11.0.0</targetPlayer>
        <swfVersion>13</swfVersion>
      </configuration>
      <dependencies>
        <dependency>
          <groupId>com.adobe.flex</groupId>
          <artifactId>compiler</artifactId>
          <version>4.5.0.20967-MOLEHILL-051211</version>
          <type>pom</type>
        </dependency>
      </dependencies>
    </plugin>
  </plugins>
</build>

You can then use Flexmojos as normal for your builds.

Please Note

This release is currently not available from the Sonatype repository, and not supported by them. All support requests and discussions should be directed to the Google group http://groups.google.com/group/flex-sdk-maven-install where everybody is welcome.

The release was deployed following the instructions in “Installing Flex SDK’s to Maven Repositories” with just a few tweaks (the molehill playerglobal.swc was injected as a flash player 11 playerglobal into the bundle – see the github repository for the files)

The Git repository is here.

http://github.com/piercer/flex_sdk_maven_install

Feel free to play and experiment with SDK deployment and pease let me know how you get on.

Posted in Uncategorized | Leave a comment

Making a Maven Out Of A Molehill

If, like me, you use maven to build your actionscript applications and if, like me, you want to play with the molehill 3D API for flash player 11 then up until now it has not been easy.

Now however with the knowledge gained about installing and deploying Flex SDK’s to maven repositories it has been possible to create a completely self contained Molehill SDK for use with maven and the incubator flash player.

In order to use this SDK you need to add the following maven repository to either your .m2/settings.xml file or putting in directly in your pom of choice.

				      
<repository>
  <id>flash-nexus-repository</id>
  <url>http://www.flashnexus.org/nexus/content/groups/public</url>
</repository>

Then you will be able to access the SDK from your pom.

The Pom File

As normal you will be able to use this SDK adding the following SDK dependency to your project pom, specifying the version as 4.5.0.19786-MOLEHILL-022711.

<dependencies>
  <dependency>
     <groupId>com.adobe.flex.framework</groupId>
     <artifactId>flex-framework</artifactId>
     <version>4.5.0.19786-MOLEHILL-022711</version>
     <type>pom</type>
  </dependency>
</dependencies>

However the POM file needs a few extra bits added to work properly with the incubator flash player. You must use the beta 6 of Flex mojos for the build because this understands the swfVersion configuration parameter for the build. Then you must set the SWF version to 13 and target flash player 11.0.0. So you need to have the following in the configuration of your build at least

<build>
  <sourceDirectory>src</sourceDirectory>
  <plugins>
    <plugin>
      <groupId>org.sonatype.flexmojos</groupId>
      <artifactId>flexmojos-maven-plugin</artifactId>
      <version>4.0-beta-6</version>
      <extensions>true</extensions>
      <configuration>
        <sourceFile>{source you want to compile}</sourceFile>
        <targetPlayer>11.0.0</targetPlayer>
        <swfVersion>13</swfVersion>
      </configuration>
      <dependencies>
        <dependency>
          <groupId>com.adobe.flex</groupId>
          <artifactId>compiler</artifactId>
          <version>4.5.0.19786-MOLEHILL-022711</version>
          <type>pom</type>
        </dependency>
      </dependencies>
    </plugin>
  </plugins>
</build>

You can then use Flexmojos as normal for your builds.

Please Note

This release is currently not available from the Sonatype repository, and not supported by them. All support requests and discussions should be directed to the Google group http://groups.google.com/group/flex-sdk-maven-install where everybody is welcome.

The release was deployed following the instructions in “Installing Flex SDK’s to Maven Repositories” with just a few tweaks (the molehill playerglobal.swc was injected as a flash player 11 playerglobal into the bundle – see the github repository for the files)

The Git repository is here.

http://github.com/piercer/flex_sdk_maven_install

Feel free to play and experiment with SDK deployment and pease let me know how you get on.

Posted in Development, Flex, Flex Mojos, Uncategorized | Leave a comment

Using Flex SDK 4.5.0.19786 With Maven

The latest release of Flex SDK 4.5 (Hero 4.5.0.19786) is now available on the flash nexus maven repository.

This release was deployed following the instructions in “Installing Flex SDK’s to Maven Repositories”.

This release is currently not available from the Sonatype repository, and not supported by them. All support requests and discussions should be directed to the Google group http://groups.google.com/group/flex-sdk-maven-install where everybody is welcome.

You can use this maven repository by adding the following xml into either you .m2/settings.xml file or putting in directly in your pom of choice.

				      
<repository>
  <id>flash-nexus-repository</id>
  <url>http://www.flashnexus.org/nexus/content/groups/public</url>
</repository>

Then you will be able to use the latest Flex SDK 4.5 Beta by adding the following dependency to your project pom.

<dependencies>
 <dependency>
  <groupId>com.adobe.flex.framework</groupId>
   <artifactId>flex-framework</artifactId>
   <version>4.5.0.19786</version>
   <type>pom</type>
  </dependency>
 </dependencies>

You can then use Flexmojos as normal for your builds.

Please let me know how you get on, and please suggest other libraries to be added to the repository.

I have created a Git repository for the files used to perform this deployment and you can find them on github

http://github.com/piercer/flex_sdk_maven_install

Posted in Development, Flex, Flex Mojos | 6 Comments

Installing Flex SDKs Into Maven Repositories

Introduction

Automated building of actionscript (flash and flex) applications is becoming more and more important as the Flash Platform starts to mature. It is crucial to have automated builds in order to maintain proper continuous integration and testing practices. If you do not know what continuous integration is then please read the following if you get a chance http://en.wikipedia.org/wiki/Continuous_integration.

Two very popular automated build tools for use with Actionscript are Ant and Maven. Ant is very well supported and preferred by Adobe. However since I have started consultancy work in financial institutions and working on more ‘enterprise’ level Flex applications I have discovered that the build tool of choice is Maven. This is because it can easily (well relatively anyway) integrate Actionscript builds with Java builds and it is extremely good at managing dependencies between projects.

Continue reading

Posted in Development, Flex | Leave a comment

Flex And The City Source Material

Flex and the City was an excellent 1 day free conference in the centre of London – more please. Here are the slides from my talk on unit testing and continuous integration for Flex/Actionscript.

I hope you like it.

Posted in ContinuousIntegration, Development, FlexUNit | 1 Comment

FOTB 2010 Source Material

Morning all. Just back from Flash on the Beach 2010. It was awesome and I will talk more about it later, but for now here are my slides and the full source code to accompany them.

I hope somebody finds them useful.

Posted in Development, Robotlegs | Tagged , , , | 4 Comments

Are Adobe Listening?

I recently moved to IntellJ for all of my Flex development. This is because I like the very powerful refactorings available with this ide, and the way that it can use POM’s to manage projects. I do still like Flash Builder though and think it was an improvement over Flex Builder.

So it was with great interest that I read this post by Jesse Warden Adobe, Please Bring Flash Builder Up To Par, and noted that Andrew Shorten had responded that Adobe were listening.

In Andrew’s response he mentioned that people should post ideas in http://ideas.adobe.com/. This seemed like a good idea and many people have spent time posting ideas and voting on them over the last 6 months. However there is no evidence that Adobe ever looks at the site. Every single idea is still listed as a ‘New Submission’ even after 6 months, and none of the top ideas have had any comments added by anybody from Adobe.

With respect to bugs, it has to be said that Adobe are not the best communicators either. For example the following user submitted bug (2 years ago it seems) https://bugs.adobe.com/jira/browse/FB-15844 has now been closed. However even after being asked it is still totally unclear as to when this fix will be made available to the public.

So Andrew, it’s all very well saying you are listening, but, please, can you be seen to be listening.

Posted in Development | 5 Comments