-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OpenCL Model #744
Open
tonghaining
wants to merge
23
commits into
hernanponcedeleon:development
Choose a base branch
from
tonghaining:opencl1
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add OpenCL Model #744
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
f5ddde7
add OpenCl mm
tonghaining d91d2ba
add NAL tag
tonghaining 7049202
add default tags
tonghaining 8cd51ed
update tag
tonghaining d2160eb
add overhauling models
tonghaining 4cf481a
update opencl models
tonghaining 11de6f9
add rmw axiom
tonghaining fbfead9
rename opencl models
tonghaining 9e12f57
use overhauling models
tonghaining b2641a5
add c11 partialsc and simp
tonghaining bcd1978
replace NA with NAL
tonghaining 2b96310
add NAL to c11 Init
tonghaining b4644b4
update c11&opencl model names
tonghaining c7c1fb1
add openclBarrier
tonghaining 68adc51
clean code
tonghaining 0705298
add REL/ACQ to EF and XF
tonghaining 2ec066e
initialize Reg after thread created
tonghaining bd48d29
update coh axiom
tonghaining a63dd9c
update visitors and tags
tonghaining 533d214
update tag to expressions
tonghaining a02dbd2
remove .cl
tonghaining 7821c1d
add thread scope setter
tonghaining fa74eb7
change opencl litmus format
tonghaining File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
C "C++11" | ||
|
||
(* | ||
* Overhauling SC atomics in C11 and OpenCL. | ||
* M. Batty, A. Donaldson, J. Wickerson. In Proc. | ||
* 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), 2016. | ||
*) | ||
|
||
(* | ||
* This model is based on: | ||
* https://multicore.doc.ic.ac.uk/overhauling/c11_base.cat | ||
* https://multicore.doc.ic.ac.uk/overhauling/c11_partialSC.cat | ||
*) | ||
|
||
include "basic.cat" | ||
include "c11_cos.cat" | ||
include "c11_los.cat" | ||
|
||
let asw = IW * (M \ IW) | ||
let sb = po | ||
let mo = co & (~NAL * ~NAL) | ||
|
||
let cacq = ACQ | (SC & (R | F)) | ACQ_REL | (F & CON) | ||
let crel = REL | (SC & (W | F)) | ACQ_REL | ||
let ccon = R & CON | ||
|
||
// To be compatible with reads from uninit memory, we use our default definition of fr | ||
//let fr = rf^-1 ; mo | ||
|
||
let dd = (data | addr)+ | ||
|
||
let fsb = [F] ; sb | ||
let sbf = sb ; [F] | ||
|
||
(* release_acquire_fenced_synchronizes_with, hypothetical_release_sequence_set, release_sequence_set *) | ||
|
||
(* OLD: let rs = [crel] ; fsb? ; [A & W] ; (((mo ; [rmw]) | coi) & ~(coe ; [!rmw] ; mo))? *) | ||
let rs_prime = int | (_ * (R & W)) | ||
let rs = mo & rs_prime \ ((mo \ rs_prime) ; mo) | ||
|
||
(* OLD: let swra = ext & (rs ; rf ; [A] ; sbf? ; [cacq]) *) | ||
let swra = ext & ([crel] ; fsb? ; [A & W] ; rs? ; rf ; [R & A] ; sbf? ; [cacq]) | ||
|
||
//let swul = ext & ([UL] ; lo ; [LK]) | ||
let pp_asw = asw \ (asw ; sb) | ||
//let sw = pp_asw | swul | swra | ||
let sw = pp_asw | swra | ||
|
||
(* with_consume_cad_set, dependency_ordered_before *) | ||
let cad = ((rf & sb) | dd)+ | ||
let dob = (ext & ([W & crel] ; fsb? ; [A & W] ; rs?; rf; [ccon])); cad? | ||
|
||
(* happens_before, inter_thread_happens_before, consistent_hb *) | ||
let ithbr = sw | dob | (sw ; sb) | ||
let ithb = (ithbr | (sb ; ithbr))+ | ||
let hb = sb | ithb | ||
acyclic hb as Hb | ||
|
||
(* coherent_memory_use *) | ||
let hbl = hb & loc | ||
|
||
irreflexive ((rf^-1)? ; mo ; rf? ; hb) as Coh | ||
|
||
(* visible_side_effect_set *) | ||
let vis = ([W] ; hbl ; [R]) & ~(hbl; [W]; hbl) | ||
|
||
(* consistent_atomic_rf *) | ||
irreflexive (rf ; hb) as Rf | ||
|
||
(* consistent_non_atomic_rf *) | ||
empty ((rf ; [NAL]) \ vis) as NaRf | ||
|
||
(* Consistency of RMWs *) | ||
empty rmw & (fre; coe) as atomic | ||
// The original model was tested with Herd, which treats RMW as a single atomic operation. | ||
// We have modified the model to handle RMW as a sequence of atomic operations. | ||
// irreflexive (rf | (mo ; mo ; rf^-1) | (mo ; rf)) as Rmw | ||
|
||
|
||
(* locks_only_consistent_lo *) | ||
// irreflexive (lo ; hb) as Lo1 | ||
|
||
(* locks_only_consistent_locks *) | ||
// irreflexive ([LS] ; lo^-1 ; [LS] ; ~(lo ; [UL] ; lo)) as Lo2 | ||
|
||
(* data_races *) | ||
let cnf = ((W * _) | (_ * W)) & loc | ||
let dr = ext & (cnf \ hb \ (hb^-1) \ (A * A)) | ||
|
||
(* unsequenced_races *) | ||
let ur = int & ((W * M) | (M * W)) & loc & ~id & ~(sb+) & ~((sb+)^-1) | ||
|
||
(* locks_only_good_mutex_use, locks_only_bad_mutexes *) | ||
// let bl = ([LS]; (sb & lo); [LK]) & ~(lo; [UL]; lo) | ||
// let losbwoul = (sb & lo & ~(lo; [UL]; lo)) | ||
// let lu = [UL] & ~([UL] ; losbwoul^-1 ; [LS] ; losbwoul ; [UL]) | ||
|
||
(* Partial SC axioms *) | ||
let r1 = hb | ||
let r2 = fsb? ; mo ; sbf? | ||
let r3 = rf^-1; [SC] ; mo | ||
let r4 = rf^-1 ; hbl ; [W] | ||
let r5 = fsb ; fr | ||
let r6 = fr ; sbf | ||
let r7 = fsb ; fr ; sbf | ||
|
||
let scp = r1|r2|r3|r4|r5|r6|r7 | ||
|
||
acyclic (((SC * SC) & scp) \ id) as Spartial |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without init events, the initial memory is neither tagged
NONATOMIC
norNON_ATOMIC_LOCATION
. I think this might cause issues.