Skip to content

Commit

Permalink
Merge pull request #715 from utwente-fmt/enable-gpgpu-testing
Browse files Browse the repository at this point in the history
Enable GPGPU examples for testing
  • Loading branch information
bobismijnnaam authored Nov 2, 2021
2 parents 0a60d4e + 6a8c4fe commit eb76c26
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 1 deletion.
6 changes: 6 additions & 0 deletions col/src/main/java/vct/col/ast/type/TypeExpression.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ case class TypeExpression(val operator:TypeOperator, val types:List[Type]) exten
override def isNumeric: Boolean =
if (isLeaky) firstType.isNumeric else false

override def isIntegerType: Boolean =
if (isLeaky) firstType.isIntegerType else false

override def isInteger: Boolean =
if (isLeaky) firstType.isInteger else false

override def supertypeof(context: ProgramUnit, t: Type): Boolean =
if (isLeaky) firstType.supertypeof(context, t) else false

Expand Down
6 changes: 6 additions & 0 deletions examples/gpgpu/ASSSP.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
//:: case ASSSP

/* Currently this file does not pass because of some renaming errors. Mohsen Safari might have a version in which
* data-race freedom is verified, and which was also used in his ASSSP paper. This file might be included in the future,
* and can then replace this file.
*/

/***********************************************************************************
Created by Mohsen Safari.
************************************************************************************/
Expand Down
1 change: 1 addition & 0 deletions examples/gpgpu/ASSSPv3.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//:: case ASSSPv3
//:: tool silicon
/***********************************************************************************
Created by Mohsen Safari.
************************************************************************************/
Expand Down
5 changes: 5 additions & 0 deletions examples/gpgpu/ASSSPv4.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//:: case ASSSPv4

/* Currently this file does not verify because CUDA features are needed that VerCors doesn't support yet. This file
* is included in the example folder to serve as an example of CUDA features we might want in the future.
*/

/***********************************************************************************
Created by Mohsen Safari.
************************************************************************************/
Expand Down
5 changes: 5 additions & 0 deletions examples/gpgpu/GPGPU-Example-updates.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
//:: case GPGPUExampleUpdates

/* This is the realistic version of GPGPU-Example.cu, with the difference that this version uses actual CUDA functions,
* such as cudaMemcpy. Unfortunately this file cannot be verified yet as VerCors does not yet support these primitives.
* Therefore it is not included in the test suite.
*/

/***********************************************************************************
Created by Mohsen Safari.
************************************************************************************/
Expand Down
9 changes: 8 additions & 1 deletion examples/gpgpu/GPGPU-Example.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
//:: case GPGPUExample
//:: tool silicon

/* This is the verifiable version of GPGPU-Example-updates.cu, with the difference being that we use custom functions
* for modelling the GPU here (vercorsCudaMalloc, vercorsCudaFreeInt, etc.) instead of actual CUDA functions. This
* example is verified to be memory safe and has some functional properties.
*/

/***********************************************************************************
Created by Mohsen Safari.
************************************************************************************/
Expand All @@ -22,7 +29,7 @@ __global__ void CUDAKernel(int* g_array1, int* g_array2, int N)
{
int tid = blockIdx.x * N + threadIdx.x;
//@ assert tid == \gtid;
atomicMin(g_array1 + tid, g_array2[tid]) /*@ then { assert false && false; } */;
atomicMin(g_array1 + tid, g_array2[tid]);
}

//@ ensures \pointer(\result, N, write);
Expand Down
1 change: 1 addition & 0 deletions examples/gpgpu/cuda.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//:: cases BasicCuda
//:: tool silicon
//:: verdict Pass

#include <cuda.h>
Expand Down
1 change: 1 addition & 0 deletions examples/gpgpu/opencl.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//:: cases BasicOpenCL
//:: tool silicon
//:: verdict Pass

#include <opencl.h>
Expand Down

0 comments on commit eb76c26

Please sign in to comment.