aboutsummaryrefslogtreecommitdiff
path: root/libgomp/ChangeLog.omp
blob: 922e00fbff5b5e3fac28e7343b02fec4fb9a4cb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
2020-03-26  Thomas Schwinge <thomas@codesourcery.com>

	* oacc-init.c (acc_init_1): Move other 'acc_init_state' logic to
	where it belongs.

2020-03-25  Thomas Schwinge <thomas@codesourcery.com>

	* oacc-init.c (acc_init_1): Move 'acc_init_state' logic to where
	it belongs.

2019-11-22  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* testsuite/libgomp.oacc-fortran/lib-16.f90: Fix async-safety issue.

2019-10-16  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-fortran/gangprivate-attrib-1.f90: Use
	oaccdevlow dump and update scanned output.
	* testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90: Likewise.
	Add missing atomic to force worker partitioning for test variable.

2019-10-16  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/serial-dims.c: Support AMD GCN.

2019-10-09  Tobias Burnus  <tobias@codesourcery.com>

	* testsuite/libgomp.fortran/use_device_ptr1.f90: New.

2019-09-20  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-fortran/privatized-ref-1.f95: New test.
	* testsuite/libgomp.oacc-c++/privatized-ref-2.C: New test.
	* testsuite/libgomp.oacc-c++/privatized-ref-3.C: New test.

2019-09-19  Julian Brown  <julian@codesourcery.com>

	* plugin/plugin-nvptx.c (GOMP_OFFLOAD_openacc_async_host2dev):
	Add EPHEMERAL parameter, and FIXME function comment.

2019-09-18  Tobias Burnus  <tobias@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Fix dg-warning
	line numbers.
	* testsuite/libgomp.oacc-c-c++-common/serial-dims.c: Likewise.

2019-09-18  Tobias Burnus  <tobias@codesourcery.com>

	* linux/gomp_print.c (gomp_print_integer): Use PRId64 if available,
	otherwise cast for %ld.

2019-09-17  Julian Brown  <julian@codesourcery.com>

	* libgomp-plugin.h (GOMP_OFFLOAD_openacc_async_host2dev): Update
	prototype.
	* libgomp.h (gomp_copy_host2dev): Update prototype.
	* oacc-host.c (host_openacc_async_host2dev): Add ephemeral parameter.
	* oacc-mem.c (memcpy_tofrom_device): Update call to gomp_copy_host2dev.
	(update_dev_host): Likewise.
	* oacc-parallel.c (GOACC_enter_exit_data): Call async versions of
	acc_attach/acc_detach/acc_detach_finalize functions.
	* plugin/plugin-gcn.c (wait_for_queue_nonfull): Don't lock/unlock
	aq->mutex here.
	(queue_push_launch): Lock aq->mutex before calling
	wait_for_queue_nonfull.
	(queue_push_callback): Likewise.
	(queue_push_asyncwait): Likewise.
	(queue_push_placeholder): Likewise.
	(GOMP_OFFLOAD_openacc_async_host2dev): Add ephemeral parameter.  Copy
	source data to temporary space immediately if true, and pass to
	queue_push_copy.
	(goacc_device_copy_async): Remove.
	(gomp_copy_host2dev): Add ephemeral parameter. Update function comment.
	Call async host2dev plugin hook directly.
	(gomp_copy_dev2host): Call async dev2host plugin hook directly.
	(gomp_map_vars_existing, gomp_map_pointer, gomp_attach_pointer,
	gomp_detach_pointer): Update calls to gomp_copy_host2dev.
	(gomp_map_vars_internal): Don't use coalescing buffer for asynchronous
	copies. Update calls to gomp_copy_host2dev.
	(gomp_update): Update calls to gomp_copy_host2dev.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c (main): Fix
	async-safety issue. Increase number of iterations.
	* testsuite/libgomp.oacc-fortran/lib-16-2.f90: Fix async-safety issue.

2019-09-17  Julian Brown  <julian@codesourcery.com>

	* oacc-host.c (host_openacc_async_queue_callback): Invoke callback
	function immediately.
	* oacc-parallel.c (struct async_prof_callback_info, async_prof_dispatch,
	queue_async_prof_dispatch): New.
	(GOACC_parallel_keyed): Call queue_async_prof_dispatch for asynchronous
	profile-event dispatches.
	(GOACC_enter_exit_data): Likewise.
	(GOACC_update): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-init-1.c
	(cb_compute_construct_start): Remove/fix TODO.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-parallel-1.c
	(cb_exit_data_start): Tweak expected state values.
	(cb_exit_data_end): Likewise.
	(cb_compute_construct_start): Remove/fix TODO.
	(cb_compute_construct_end): Don't do adjustments for
	acc_ev_enqueue_launch_start/acc_ev_enqueue_launch_end callbacks.
	(cb_compute_construct_end): Tweak expected state values.
	(cb_enqueue_launch_start, cb_enqueue_launch_end): Don't expect
	launch-enqueue operations to happen synchronously with respect to
	profiling events on async streams.
	(main): Tweak expected state values.
	* testsuite/libgomp.oacc-c-c++-common/lib-94.c (main): Reorder
	operations for async-safety.

2019-09-17  Julian Brown  <julian@codesourcery.com>

	* target.c (gomp_map_vars_internal): Remove read of uninitialised
	data.

2019-09-17  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/async_queue-1.c: Only run
	NVidia-specific test on NVidia hardware.
	* testsuite/libgomp.oacc-c-c++-common/asyncwait-nop-1.c (main):
	Initialise for acc_device_gcn if testing on AMD GCN.
	* testsuite/libgomp.oacc-c-c++-common/function-not-offloaded.c: Support
	AMD GCN.
	* testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c (check): Skip
	vector dimension test for AMD GCN.

2019-09-13  Tobias Burnus  <tobias@codesourcery.com>

	* plugin/plugin-gcn.c (hsa_warn, hsa_fatal, hsa_error): Ensure
	string is initialized.

2019-09-10  Julian Brown  <julian@codesourcery.com>

	* plugin/plugin-gcn.c (GOMP_hsa_kernel_dispatch): Remove
	omp_data_memory, kernel_dispatch_count, debug, omp_level,
	children_dispatches and omp_num_threads fields.
	(hsa_kernel_description): Remove omp_data_size, gridified_kernel_p,
	kernel_dependencies_count, kernel_dependencies fields to match
	mkoffload output.
	(kernel_info): Remove omp_data_size, dependencies, dependencies_count,
	max_omp_data_size and gridified_kernel_p fields.
	(init_basic_kernel_info): Don't copy newly-deleted fields.
	(create_single_kernel_dispatch): Remove omp_data_size parameter.
	Remove write-only initialization of deleted GOMP_hsa_kernel_dispatch
	fields.
	(release_kernel_dispatch): Update debug output.  Don't free deleted
	omp_data_memory field.
	(init_single_kernel): Remove max_omp_data_size parameter. Remove deleted
	fields from debug output.
	(print_kernel_dispatch): Don't print deleted fields.
	(create_kernel_dispatch): Remove omp_data_size parameter.
	(init_kernel): Update calls to init_single_kernel and
	create_kernel_dispatch.

2019-09-10  Julian Brown  <julian@codesourcery.com>

	* plugin/plugin-gcn.c (struct placeholder, struct asyncwait_info,
	enum entry_type): New.
	(queue_entry): Use entry_type enum for tag.  Add asyncwait and
	placeholder event type fields.
	(wait_for_queue_nonfull): New function.
	(queue_push_launch): Use above function instead of raising a fatal
	error on queue-full condition.  Use KERNEL_LAUNCH instead of hardwired
	0.
	(queue_push_callback): Use wait_for_queue_nonfull instead of open-coded
	wait sequence.  Use CALLBACK instead of hardwired 1.
	(queue_push_asyncwait, queue_push_placeholder): New.
	(execute_queue_entry): Implement ASYNC_WAIT and ASYNC_PLACEHOLDER event
	types.
	(GOMP_OFFLOAD_openacc_async_serialize): Use queue_push_placeholder and
	queue_push_asyncwait instead of host-synchronized wait_queue calls.
	* testsuite/libgomp.oacc-c-c++-common/data-2-lib.c (main): Add missing
	asynchronous waits.
	* testsuite/libgomp.oacc-c-c++-common/data-2.c (main): Likewise.

2019-09-10  Julian Brown  <julian@codesourcery.com>

	* plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_async_host2dev): Enqueue
	copy from src_copy not src.

2019-09-10  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* config/gcn/team.c (gomp_gcn_exit_kernel): Free GCN thread list.

2019-09-10  Andrew Stubbs  <ams@codesourcery.com>

	* plugin/plugin-gcn.c (HSA_AMD_AGENT_INFO_COMPUTE_UNIT_COUNT): Define.
	(dump_hsa_agent_info): Dump compute unit count.
	(get_cu_count): New function.
	(parse_target_attributes): Use get_cu_count for default gdims.
	(gcn_exec): Likewise.

2019-09-10  Andrew Stubbs  <ams@codesourcery.com>

	* plugin/plugin-gcn.c (obstack_chunk_alloc): Delete.
	(obstack_chunk_free): Delete.
	(obstack.h): Remove include.
	(create_and_finalize_hsa_program): Remove all unmodified_sections_os
	and use sections directly from the issue.
	Use "or 0x80" instead of SHT_NOTE to hide relocations, and then
	simply recognise that ourselves.

2019-09-09  Andrew Stubbs  <ams@codesourcery.com>

	* plugin/plugin-gcn.c (struct hsa_runtime_fn_info): Add
	hsa_memory_assign_agent_fn.
	(struct agent_info): Add data_region.
	(init_hsa_runtime_functions): Initialize hsa_memory_assign_agent.
	(get_kernarg_memory_region): Move contents to new function ...
	(get_memory_region): ... here.
	(get_data_memory_region): New function.
	(GOMP_OFFLOAD_get_property): Use data_region, not kernarg_region.
	(GOMP_OFFLOAD_init_device): Initialize data_region.
	(create_and_finalize_hsa_program): Use data_region, not
	kernarg_region, and assign heap to device agent.
	(GOMP_OFFLOAD_alloc_by_agent): Likewise.
	(image_address_p): Delete function.
	(struct copy_data): Remove use_hsa_memory_copy.
	(copy_data): Always use hsa_memory_copy.
	(queue_push_copy): Remove use_hsa_memory_copy.
	(GOMP_OFFLOAD_dev2host): Always use hsa_memory_copy.
	(GOMP_OFFLOAD_host2dev): Likewise.
	(GOMP_OFFLOAD_dev2dev): Likewise.
	(gcn_exec): Use hsa_memory_copy.
	(GOMP_OFFLOAD_openacc_async_host2dev): Always use hsa_memory_copy.
	(GOMP_OFFLOAD_openacc_async_dev2host): Likewise.

2019-09-06  Julian Brown  <julian@codesourcery.com>

	* plugin/plugin-gcn.c (GOMP_OFFLOAD_alloc_by_agent,
	GOMP_OFFLOAD_free, gcn_exec): Add profiling support.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-init-1.c: Add GCN
	support.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-kernels-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-parallel-1.c: Likewise.

2019-09-06  Julian Brown  <julian@codesourcery.com>

	* config/gcn/target.c (omp_pause_resource, omp_pause_resource_all): New
	functions, plus ialiases.

2019-09-05  Julian Brown  <julian@codesourcery.com>

	* plugin/plugin-gcn.c (gcn_exec): Change default number of workers to
	16.

2019-09-05  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-fortran/lib-13.f90: End data region after
	wait API calls.

2019-08-13  Julian Brown  <julian@codesourcery.com>

	* plugin/plugin-gcn.c (queue_push_callback): Wait on queue-full
	condition.

2019-08-13  Julian Brown  <julian@codesourcery.com>

	* plugin/plugin-gcn.c (struct copy_data): Add using_src_copy field.
	(copy_data): Free temporary buffer if using.
	(queue_push_copy): Add using_src_copy parameter.
	(GOMP_OFFLOAD_dev2dev, GOMP_OFFLOAD_async_dev2host): Update calls to
	queue_push_copy.
	(GOMP_OFFLOAD_async_host2dev): Likewise.  Allocate temporary buffer and
	copy source data to it immediately.
	* target.c (gomp_copy_host2dev): Update function comment.
	(copy_host2dev_immediate): Remove.
	(gomp_map_pointer, gomp_map_vars_internal): Replace calls to
	copy_host2dev_immediate with calls to gomp_copy_host2dev.

2019-08-08  Julian Brown  <julian@codesourcery.com>

	* plugin/plugin-gcn.c (gcn_exec): Use 1 for the default number of
	workers.

2019-08-08  Julian Brown  <julian@codesourcery.com>

	* plugin/configfrag.ac (amdgcn): Set tgt_plugin.
	* testsuite/lib/libgomp.exp (offload_target_to_openacc_device_type):
	Add AMD GCN support.
	(check_effective_target_openacc_amdgcn_accel_selected): Test
	offload_target instead of offload_target_openacc.
	* testsuite/libgomp.oacc-c++/c++.exp (amdgcn*): Rename stanza to...
	(gcn): ...this. Don't set tagopt redundantly here.
	* testsuite/libgomp.oacc-c/c.exp (amdgcn*, gcn): Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp (amdgcn*, gcn): Likewise.
	* configure: Regenerated.

2019-08-08  Julian Brown  <julian@codesourcery.com>

	* plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_exec_params,
	GOMP_OFFLOAD_openacc_async_exec_params): New functions.

2019-07-31  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Use relative
	line numbers for warning.
	* testsuite/libgomp.oacc-c-c++-common/serial-dims.c: Likewise.

2019-07-31  Julian Brown  <julian@codesourcery.com>

	* config/nvptx/gomp_print.c (gomp_print_string, gomp_print_integer,
	gomp_print_double): New.
	* plugin/plugin-nvptx.c (GOMP_OFFLOAD_openacc_async_construct): Add
	dummy device parameter.

2019-07-31  Julian Brown  <julian@codesourcery.com>

	* libgomp.map (GOMP_2.0.GOMP_4_BRANCH): Remove GOACC_parallel_keyed_v2.
	* libgomp_g.h (GOACC_parallel_keyed_v2): Remove prototype.
	* oacc-parallel.c (GOACC_parallel_keyed_internal): Rename to...
	(GOACC_parallel_keyed): ...this.  Handle GOMP_LAUNCH_ARGS_EXPLODED
	launch tag.  Remove previous wrapper functions.
	(GOACC_parallel_keyed_v2): Remove.

2019-07-31  Julian Brown  <julian@codesourcery.com>
	    Andrew Stubbs  <ams@codesourcery.com>

	* Makefile.am (libgomp_la_SOURCES): Add gomp_print.c.
	* Makefile.in: Regenerate.
	* affinity-fmt.c: Rename calls to gomp_write_string from
	gomp_print_string.
	* config.h.in (PLUGIN_GCN): Add #undef.
	* config/nvptx/libgomp-plugin.c: Rename to...
	* config/accel/libgomp-plugin.c: ...this.
	* config/nvptx/lock.c: Rename to...
	* config/accel/lock.c: ...this.
	* config/nvptx/mutex.c: Rename to...
	* config/accel/mutex.c: ...this.
	* config/nvptx/mutex.h: Rename to...
	* config/accel/mutex.h: ...this.
	* config/nvptx/oacc-async.c: Rename to...
	* config/accel/oacc-async.c: ...this.
	* config/nvptx/oacc-cuda.c: Rename to...
	* config/accel/oacc-cuda.c: ...this.
	* config/nvptx/oacc-host.c: Rename to...
	* config/accel/oacc-host.c: ...this.
	* config/nvptx/oacc-init.c: Rename to...
	* config/accel/oacc-init.c: ...this.
	* config/nvptx/oacc-mem.c: Rename to...
	* config/accel/oacc-mem.c: ...this.
	* config/nvptx/oacc-plugin.c: Rename to...
	* config/accel/oacc-plugin.c: ...this.
	* config/nvptx/omp-lock.h: Rename to...
	* config/accel/omp-lock.h: ...this.
	* config/nvptx/openacc.f90: Rename to...
	* config/accel/openacc.f90: ...this.  Add acc_device_hsa and
	acc_device_gcn.
	* config/nvptx/pool.h: Rename to...
	* config/accel/pool.h: ...this.
	* config/nvptx/proc.c: Rename to...
	* config/accel/proc.c: ...this.  Add omp_get_num_procs alias.
	* config/nvptx/ptrlock.c: Rename to...
	* config/accel/ptrlock.c: ...this.
	* config/nvptx/ptrlock.h: Rename to...
	* config/accel/ptrlock.h: ...this.
	* config/nvptx/sem.c: Rename to...
	* config/accel/sem.c: ...this.
	* config/nvptx/sem.h: Rename to...
	* config/accel/sem.h: ...this.
	* config/nvptx/thread-stacksize.h: Rename to...
	* config/accel/thread-stacksize.h: ...this.
	* config/gcn/affinity-fmt.c: New.
	* config/gcn/bar.c: New.
	* config/gcn/bar.h: New.
	* config/gcn/doacross.h: New.
	* config/gcn/gomp_print.c: New.
	* config/gcn/icv-device.c: New.
	* config/gcn/simple-bar.h: New.
	* config/gcn/target.c: New.
	* config/gcn/task.c: New.
	* config/gcn/team.c: New.
	* config/gcn/time.c: New.
	* config/linux/gomp_print.c: New.
	* configure.ac (amdgcn*-*-*): Disable pthreads.
	* configure: Regenerated.
	* configure.tgt (nvptx*-*-*): Add 'accel' config_path.
	(amdgcn*-*-*): Set config_path.
	* fortran.c (omp_display_affinity_): Rename calls to gomp_write_string
	from gomp_print_string.
	* libgomp-plugin.h (enum offload_target_type): Add
	OFFLOAD_TARGET_TYPE_GCN.
	(GOMP_OFFLOAD_openacc_async_construct): Change parameter type to int.
	* libgomp.h (gcn_thrs, set_gcn_thrs, gomp_thread): Add for __AMDGCN__.
	(gomp_print_string): Rename to...
	(gomp_write_string): ...this.
	* libgomp.map (GOMP_4.5): Add gomp_rpint_string, gomp_print_integer,
	gomp_print_double.
	* oacc-async.c (lookup_goacc_asyncqueue): Pass target_id to async queue
	construct function.
	* oacc-host.c (host_openacc_async_construct): Add dummy device
	parameter.
	* oacc-init.c (name_of_acc_device_t): Add acc_device_gcn.
	* oacc-int.h (goacc_thread): Add dummy implementation for __AMDGCN__.
	* oacc-parallel.c (GOACC_enter_exit_data): Support acc_async_noval and
	zero-length array sections.
	* omp.h.in (gomp_print_string, gomp_print_integer, gomp_print_double):
	Add prototypes.
	* omp_lib.f90.in (gomp_print_string, gomp_print_integer,
	gomp_print_double): Add interfaces.
	* openacc.f90 (openacc_kinds): Add acc_device_gcn.  Bump
	acc_device_current code.
	* openacc.h (acc_device_t): Add acc_device_gcn, bump acc_device_current
	code.
	* openacc_lib.h (acc_device_hsa, acc_device_gcn): Add.
	* plugin/Makefrag.am (PLUGIN_GCN): Support building GCN plugin.
	* plugin/configfrag.am (PLUGIN_GCN, PLUGIN_GCN_CPPFLAGS,
	PLUGIN_GCN_LDFLAGS, PLUGIN_GCN_LIBS): Add.  Add suport for GCN plugin.
	* plugin/plugin-gcn.c: New.
	* target.c (stdio.h): Include unconditionally.
	(gomp_copy_host2dev): Add function comment.
	(copy_host2dev_immediate): New function.
	(gomp_map_pointer, gomp_map_vars_internal): Use
	copy_host2dev_immediate where appropriate.
	(offload_target_to_plugin_name): Support gcn.
	* team.c (gomp_free_pool_helper): Support gcn.
	* testsuite/Makefile.in: Regenerated.
	* testsuite/lib/libgomp.exp
	(check_effective_target_openacc_amdgcn_accel_present): New.
	(check_effective_target_openacc_amdgcn_accel_selected): New.
	* testsuite/libgomp.c/c.exp (generate_tests, test_lists,
	generated_tests): New.
	(tests): Add generated tests.
	* testsuite/libgomp.c/for-1.h: New.
	* testsuite/libgomp.c/for-2.h: New.
	* testsuite/libgomp.c/for-3.h: New.
	* testsuite/libgomp.c/for-3.list: New.
	* testsuite/libgomp.c/for-5.c: New.
	* testsuite/libgomp.c/for-5.list: New.
	* testsuite/libgomp.c/for-6.c: New.
	* testsuite/libgomp.c/for-6.list: New.
	* testsuite/libgomp.c/target-print-1.c: New.
	* testsuite/libgomp.fortran/target-print-1.f90: New.
	* testsuite/libgomp.oacc-c++/c++.exp (amdgcn*): Add support for AMD GCN.
	* testsuite/libgomp.oacc-c-c++-common/atomic_capture-2.c: Adjust for
	portability.
	* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Skip unsuitable
	test for AMD GCN.
	* testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c: Adjust for
	portability.
	* testsuite/libgomp.oacc-c-c++-common/loop-v-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-wv-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-v-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/serial-dims.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/private-variables-2.c: New.
	* testsuite/libgomp.oacc-c-c++-common/tile-1.c: Skip for AMD GCN.
	* testsuite/libgomp.oacc-c/c.exp (amdgcn*): Add support for AMD GCN.
	* testsuite/libgomp.oacc-c/offload-target-1.c: Add AMD GCN support.
	* testsuite/libgomp.oacc-c/print-1.c: New.
	* testsuite/libgomp.oacc-fortran/fortran.exp (amdgcn*): Add AMD GCN
	support.
	* testsuite/libgomp.oacc-fortran/atomic_capture-1.f90: Adjust for
	portability.
	* testsuite/libgomp.oacc-fortran/collapse-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/collapse-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/error_stop-1.f: Support AMD GCN.
	* testsuite/libgomp.oacc-fortran/error_stop-2.f: Support AMD GCN.
	* testsuite/libgomp.oacc-fortran/error_stop-3.f: Support AMD GCN.
	* testsuite/libgomp.oacc-fortran/print-1.f90: New.

2019-01-23  Thomas Schwinge <thomas@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/acc_prof-kernels-1.c: Update.

2018-12-20  Maciej W. Rozycki  <macro@codesourcery.com>

	* oacc-init.c (get_property_any): Add profiling code.

2017-02-28  Thomas Schwinge  <thomas@codesourcery.com>

	* Makefile.am (libgomp_la_SOURCES): Add
	oacc-profiling-acc_register_library.c.
	* Makefile.in: Regenerate.
	* libgomp.texi: Remove paragraph about acc_register_library.
	* oacc-parallel.c (GOACC_parallel_keyed_internal): Set device_api for
	profiling.
	* oacc-profiling-acc_register_library.c: New file.
	* oacc-profiling.c (goacc_profiling_initialize): Call
	acc_register_library.  Avoid duplicate registration.
	(acc_register_library): Remove.
	* config/nvptx/oacc-profiling-acc_register_library.c:
	New empty file.
	* config/nvptx/oacc-profiling.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-dispatch-1.c: Remove
	call to acc_register_library.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-init-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-kernels-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-parallel-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-valid_bytes-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-version-1.c: Likewise.

2019-05-17  Thomas Schwinge  <thomas@codesourcery.com>

	* acc_prof.h: New file.
	* oacc-profiling.c: Likewise.
	* Makefile.am (nodist_libsubinclude_HEADERS, libgomp_la_SOURCES):
	Add these, respectively.
	* Makefile.in: Regenerate.
	* env.c (initialize_env): Call goacc_profiling_initialize.
	* oacc-plugin.c (GOMP_PLUGIN_goacc_thread)
	(GOMP_PLUGIN_goacc_profiling_dispatch): New functions.
	* oacc-plugin.h (GOMP_PLUGIN_goacc_thread)
	(GOMP_PLUGIN_goacc_profiling_dispatch): Declare.
	* libgomp.map (OACC_2.5.1): Add acc_prof_lookup,
	acc_prof_register, acc_prof_unregister, and acc_register_library.
	(GOMP_PLUGIN_1.3): Add GOMP_PLUGIN_goacc_profiling_dispatch, and
	GOMP_PLUGIN_goacc_thread.
	* oacc-int.h (struct goacc_thread): Add prof_info, api_info,
	prof_callbacks_enabled members.
	(goacc_prof_enabled, goacc_profiling_initialize)
	(_goacc_profiling_dispatch_p, _goacc_profiling_setup_p)
	(goacc_profiling_dispatch): Declare.
	(GOACC_PROF_ENABLED, GOACC_PROFILING_DISPATCH_P)
	(GOACC_PROFILING_SETUP_P): Define.
	* oacc-async.c (acc_async_test, acc_async_test_all, acc_wait)
	(acc_wait_async, acc_wait_all, acc_wait_all_async): Update for
	OpenACC Profiling Interface.
	* oacc-cuda.c (acc_get_current_cuda_device)
	(acc_get_current_cuda_context, acc_get_cuda_stream)
	(acc_set_cuda_stream): Likewise.
	* oacc-init.c (acc_init_1, goacc_attach_host_thread_to_device)
	(acc_init, acc_set_device_type, acc_get_device_type)
	(acc_get_device_num, goacc_lazy_initialize): Likewise.
	* oacc-mem.c (acc_malloc, acc_free, memcpy_tofrom_device)
	(acc_deviceptr, acc_hostptr, acc_is_present, acc_map_data)
	(acc_unmap_data, present_create_copy, delete_copyout)
	(update_dev_host): Likewise.
	* oacc-parallel.c (GOACC_parallel_keyed, GOACC_data_start)
	(GOACC_data_end, GOACC_enter_exit_data, GOACC_update, GOACC_wait):
	Likewise.
	* plugin/plugin-nvptx.c (nvptx_exec, nvptx_alloc, nvptx_free)
	(GOMP_OFFLOAD_openacc_exec, GOMP_OFFLOAD_openacc_async_exec):
	Likewise.
	* libgomp.texi: Update.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-dispatch-1.c: New
	file.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-init-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-kernels-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-parallel-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-valid_bytes-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-version-1.c:
	Likewise.

2019-07-10  Cesar Philippidis  <cesar@codesourcery.com>

	* target.c (gomp_load_image_to_device): Allow the accelerator to
	possess more offloaded functions than the host.

2019-07-10  Julian Brown  <julian@codesourcery.com>

	* oacc-parallel.c (GOACC_enter_exit_data): Fix optional arguments for
	changes to clause stripping in enter data/exit data directives.
	* testsuite/libgomp.oacc-fortran/class-ptr-param.f95: New test.
	* testsuite/libgomp.oacc-fortran/classtypes-1.f95: New test.
	* testsuite/libgomp.oacc-fortran/classtypes-2.f95: New test.
	* testsuite/libgomp.oacc-fortran/derivedtype-1.f95: New test.
	* testsuite/libgomp.oacc-fortran/derivedtype-2.f95: New test.
	* testsuite/libgomp.oacc-fortran/multidim-slice.f95: New test.

2019-05-28  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90: New test.

2019-01-30  Andrew Jenner  <andrew@codesourcery.com>

	* testsuite/libgomp.fortan/fortran.exp (lang_link_flags): Add
	-lquadmath.
	* testsuite/libgomp.oacc-fortran/fortran.exp (lang_link_flags): Add
	-lquadmath.

2019-05-30  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* libgomp_g.h: Include stdint.h instead of gstdint.h.

2019-05-20  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c: Expect
	"optimized:" not "note:" in warnings.
	* testsuite/libgomp.oacc-c-c++-common/serial-dims.c: Fix typos in
	warnings.

2019-05-16  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/kernels-for-index-reuse-1.c: New
	test.

2019-05-16  Julian Brown  <julian@codesourcery.com>

	* target.c (gomp_map_vars_async): Initialise KEY and OFFSET fields in
	not-present case.

2019-01-09  Julian Brown  <julian@codesourcery.com>

	* libgomp.texi: Update mentions of OpenACC version to 2.6.  Update
	section numbers to match version 2.6 of the spec.
	* openacc.f90 (openacc_version): Update to 201711.
	* openacc_lib.h (openacc_version): Update to 201711.
	* testsuite/libgomp.oacc-fortran/openacc_version-1.f: Update expected
	openacc_version to 201711.
	* testsuite/libgomp.oacc-fortran/openacc_version-2.f90: Likewise.

2019-01-23  Thomas Schwinge  <thomas@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/acc_prof-kernels-1.c:
	Update.
	* testsuite/libgomp.oacc-c-c++-common/avoid-offloading-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/avoid-offloading-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/avoid-offloading-3.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c:
	Likewise.
	* testsuite/libgomp.oacc-fortran/avoid-offloading-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/avoid-offloading-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/avoid-offloading-3.f: Likewise.
	* testsuite/libgomp.oacc-fortran/initialize_kernels_loops.f90:
	Likewise.

2019-01-24  Thomas Schwinge  <thomas@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c: New
	file.

2019-01-30  Thomas Schwinge  <thomas@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c:
	Add "-fopenacc-kernels=parloops".
	* testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-empty.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-3.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-4.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-5.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-6.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-collapse.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-enter-exit-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-enter-exit.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-update.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-data.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-g.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-mod-not-zero.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-n.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-nest.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-parallel-loop-data-enter-exit.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-reduction-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-reduction.c:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-2.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-data.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-parallel-loop-data-enter-exit.f95:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-reduction-1.f90:
	Likewise.

2018-12-20  Maciej W. Rozycki  <macro@codesourcery.com>

	* libgomp.h (gomp_device_descr): Add `get_property_func' member.
	* libgomp-plugin.h (gomp_device_property_value): New union.
	(gomp_device_property_value): New prototype.
	* openacc.h (acc_device_t): Add `acc_device_current' enumeration
	constant.
	(acc_device_property_t): New enum.
	(acc_get_property, acc_get_property_string): New prototypes.
	* oacc-init.c (acc_get_device_type): Also assert on
	`!acc_device_current' result.
	(get_property_any, acc_get_property, acc_get_property_string):
	New functions.
	* openacc.f90 (openacc_kinds): From `iso_fortran_env' also
	import `int64'.  Add `acc_device_current' and
	`acc_property_memory', `acc_property_free_memory',
	`acc_property_name', `acc_property_vendor' and
	`acc_property_driver' constants.  Add `acc_device_property' data
	type.
	(openacc_internal): Add `acc_get_property' and
	`acc_get_property_string' interfaces.  Add `acc_get_property_h',
	`acc_get_property_string_h', `acc_get_property_l' and
	`acc_get_property_string_l'.
	(openacc_c_string): New module.
	* oacc-host.c (host_get_property): New function.
	(host_dispatch): Wire it.
	* target.c (gomp_load_plugin_for_device): Handle `get_property'.
	* libgomp.map (OACC_2.6): Add `acc_get_property',
	`acc_get_property_h_', `acc_get_property_string' and
	`acc_get_property_string_h_' symbols.
	* libgomp.texi (OpenACC Runtime Library Routines): Add
	`acc_get_property'.
	(acc_get_property): New node.

	* plugin/plugin-hsa.c (GOMP_OFFLOAD_get_property): New function.
	* plugin/plugin-nvptx.c (CUDA_CALLS): Add `cuDeviceGetName',
	`cuDeviceTotalMem', `cuDriverGetVersion' and `cuMemGetInfo'
	calls.
	(GOMP_OFFLOAD_get_property): New function.

	* testsuite/libgomp.oacc-c-c++-common/acc-get-property.c: New
	test.
	* testsuite/libgomp.oacc-fortran/acc-get-property.f: New test.

2018-12-19  Julian Brown  <julian@codesourcery.com>
            Maciej W. Rozycki  <macro@codesourcery.com>

	* target.c (gomp_map_vars_async): Support GOMP_MAP_NO_ALLOC.

	* testsuite/libgomp.oacc-c-c++-common/nocreate-1.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/nocreate-2.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/nocreate-3.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/nocreate-4.c: New test.
	* testsuite/libgomp.oacc-fortran/nocreate-1.f90: New test.
	* testsuite/libgomp.oacc-fortran/nocreate-2.f90: New test.

2018-12-20  Maciej W. Rozycki  <macro@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/serial-dims.c: New test.

2017-12-21  Cesar Philippidis  <cesar@codesourcery.com>

	* Makefile.am: Add libffi build dependency.
	* configure.ac: Likewise.
	* Makefile.in: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* libgomp-plugin.h: Define GOMP_OFFLOAD_openacc_exec_params and
	GOMP_OFFLOAD_openacc_async_exec_params.
	* libgomp.h (acc_dispatch_t): Use them here.
	* libgomp.map (GOACC_parallel_keyed_v2): Declare.
	* libgomp_g.h (GOACC_parallel_keyed_v2): Likewise.
	* oacc-host.c (host_openacc_exec_params): New function.
	(host_openacc_async_exec_params): Likewise.
	* oacc-parallel.c (goacc_call_host_fn): Likewise.
	(GOACC_parallel_keyed_internal): Likewise.
	(GOACC_parallel_keyed): Wrapper for GOACC_parallel_keyed_internal.
	(GOACC_parallel_keyed_v2): Likewise.
	* plugin/plugin-nvptx.c (nvptx_exec): Replace CUDeviceptr dp parameter
	with void **kargs.
	(openacc_exec_internal): New function.
	(GOMP_OFFLOAD_openacc_exec_params): New function.
	(GOMP_OFFLOAD_openacc_exec): Update to call openacc_exec_internal.
	(openacc_async_exec_internal): New function.
	(GOMP_OFFLOAD_openacc_async_exec_params): New function.
	(GOMP_OFFLOAD_openacc_async_exec): Update call to
	openacc_async_exec_internal.
	* target.c (gomp_load_plugin_for_device): Handle
	openacc_exec_params and openacc_async_exec_params.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/libgomp.oacc-c-c++-common/combined-directives-1.c:
	Xfail on offloaded targets.

	* Makefile.def: Bootstrap module libffi. Add libffi dependency
	to all-target-libgomp.
	* Makefile.in: Regenerate.
	* configure.ac: Add libffi to bootstrap_target_libs when libgomp
	is bootstrapped.
	* configure: Regenerate.

2018-12-21  Gergö Barany  <gergo@codesourcery.com>

	* libgomp.h (enum gomp_map_vars_kind): Add
	GOMP_MAP_VARS_OPENACC_IF_PRESENT.
	* oacc-parallel.c (GOACC_data_start): Handle
	GOACC_FLAG_HOST_DATA_IF_PRESENT flag.
	* target.c (gomp_map_vars_async): Handle
	GOMP_MAP_VARS_OPENACC_IF_PRESENT mapping kind.
	* testsuite/libgomp.oacc-c-c++-common/host_data-6.c: New test.

2018-12-20  Gergö Barany  <gergo@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-1.c:
	Add missing reduction clauses.
	* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-3.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c:
	Likewise.

2019-01-30  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* testsuite/libgomp.oacc-fortran/optional-cache.f95
	* testsuite/libgomp.oacc-fortran/optional-data-copyin-by-value.f90
	* testsuite/libgomp.oacc-fortran/optional-data-copyin.f90
	* testsuite/libgomp.oacc-fortran/optional-data-copyout.f90
	* testsuite/libgomp.oacc-fortran/optional-data-enter-exit.f90
	* testsuite/libgomp.oacc-fortran/optional-declare.f90
	* testsuite/libgomp.oacc-fortran/optional-firstprivate.f90
	* testsuite/libgomp.oacc-fortran/optional-host_data.f90
	* testsuite/libgomp.oacc-fortran/optional-nested-calls.f90
	* testsuite/libgomp.oacc-fortran/optional-private.f90
	* testsuite/libgomp.oacc-fortran/optional-reduction.f90
	* testsuite/libgomp.oacc-fortran/optional-update-device.f90
	* testsuite/libgomp.oacc-fortran/optional-update-host.f90

2019-01-30  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* oacc-mem.c (update_dev_host): Return early if the host address
	is NULL.
	* testsuite/libgomp.oacc-c-c++-common/lib-43.c: Remove.
	* testsuite/libgomp.oacc-c-c++-common/lib-47.c: Likewise.

2018-12-11  Julian Brown  <julian@codesourcery.com>
	    Chung-Lin Tang  <cltang@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/gang-private-1.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c: New test.
	* testsuite/libgomp.oacc-c/pr85465.c: New test.
	* testsuite/libgomp.oacc-fortran/gangprivate-attrib-1.f90: New test.kk

2019-03-19  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/lib-93.c: Adjust target selector.

2018-09-20  Tom de Vries  <tdevries@suse.de>
	    Cesar Philippidis  <cesar@codesourcery.com>

	* oacc-init.c (acc_init_state_lock, acc_init_state, acc_init_thread):
	New variable.
	(acc_init_1): Set acc_init_thread to pthread_self ().  Set
	acc_init_state to initializing at the start, and to initialized at the
	end.
	(self_initializing_p): New function.
	(acc_get_device_type): Return acc_device_none if called by thread that
	is currently executing acc_init_1.

2018-09-05  Cesar Philippidis  <cesar@codesourcery.com>
	    Chung-Lin Tang  <cltang@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/privatize-reduction-1.c: New
	test.
	* testsuite/libgomp.oacc-c-c++-common/privatize-reduction-2.c: New
	test.

2018-09-20  Cesar Philippidis  <cesar@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Adjust test case
	to conform to the new behavior of the auto clause in OpenACC 2.5.

2018-10-04  Cesar Philippidis  <cesar@codesourcery.com>
            Julian Brown  <julian@codesourcery.com>

	* oacc-mem.c (gomp_acc_declare_allocate): New function.
	* oacc-parallel.c (GOACC_enter_exit_data): Handle
	GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}.
	* testsuite/libgomp.oacc-fortran/allocatable-array.f90: New test.
	* testsuite/libgomp.oacc-fortran/allocatable-scalar.f90: New test.
	* testsuite/libgomp.oacc-fortran/declare-allocatable-1.f90: New test.
	* testsuite/libgomp.oacc-fortran/declare-allocatable-2.f90: New test.
	* testsuite/libgomp.oacc-fortran/declare-allocatable-3.f90: New test.
	* testsuite/libgomp.oacc-fortran/declare-allocatable-4.f90: New test.

2018-12-22  Cesar Philippidis  <cesar@codesourcery.com>
            Julian Brown  <julian@codesourcery.com>

	* oacc-parallel.c (GOACC_parallel_keyed): Handle
	GOMP_MAP_FIRSTPRIVATE_INT host addresses.
	* plugin/plugin-nvptx.c (nvptx_exec): Handle
	GOMP_MAP_FIRSTPRIVATE_INT host addresses.
	* testsuite/libgomp.oacc-c++/firstprivate-int.C: New test.
	* testsuite/libgomp.oacc-c-c++-common/firstprivate-int.c: New
	test.
	* testsuite/libgomp.oacc-fortran/firstprivate-int.f90: New test.

2018-08-28  Julian Brown  <julian@codesourcery.com>
            Cesar Philippidis  <cesar@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/pr70828.c: New test.
	* testsuite/libgomp.oacc-fortran/implicit_copy.f90: New test.
	* testsuite/libgomp.oacc-fortran/pr70828.f90: New test.
	* testsuite/libgomp.oacc-fortran/pr70828-2.f90: New test.
	* testsuite/libgomp.oacc-fortran/pr70828-3.f90: New test.
	* testsuite/libgomp.oacc-fortran/pr70828-4.f90: New test.
	* testsuite/libgomp.oacc-fortran/pr70828-5.f90: New test.
	* testsuite/libgomp.oacc-fortran/pr70828-6.f90: New test.

2018-10-05  Nathan Sidwell  <nathan@acm.org>
	    Tom de Vries  <tdevries@suse.de>
	    Thomas Schwinge  <thomas@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: Add -w.
	* testsuite/libgomp.oacc-c-c++-common/loop-g-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-warn-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c: Update.
	* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/mode-transitions.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/private-variables.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-7.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Likewise.
	* testsuite/libgomp.oacc-fortran/par-reduction-2-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/par-reduction-2-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/pr84028.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/private-variables.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/routine-7.f90: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-default-compile.c: New.

2018-10-22  James Norris  <jnorris@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>
	    Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/data-2.c: Update parallel
	regions to denote variables copyied in via acc enter data as
	present.
	* testsuite/libgomp.oacc-fortran/data-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/data-4.f90: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/subr.h: Reimplement.
	* testsuite/libgomp.oacc-c-c++-common/subr.ptx: Regenerated PTX.
	* testsuite/libgomp.oacc-c-c++-common/timer.h: Removed.
	* testsuite/libgomp.oacc-c-c++-common/lib-69.c: Change async checks.
	* testsuite/libgomp.oacc-c-c++-common/lib-70.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-71.c: Rework kernel i/f.
	* testsuite/libgomp.oacc-c-c++-common/lib-72.c: Rework kernel i/f and
	change async checks.
	* testsuite/libgomp.oacc-c-c++-common/lib-73.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-74.c: Rework kernel i/f and
	timing checks.
	* testsuite/libgomp.oacc-c-c++-common/lib-75.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-76.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-77.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-78.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-79.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-80.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-81.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-82.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-93.c: New test.

2018-12-13  Cesar Philippidis  <cesar@codesourcery.com>
            Nathan Sidwell  <nathan@acm.org>
            Julian Brown  <julian@codesourcery.com>

        * libgomp.oacc-c-c++-common/par-reduction-3.c: New test.
        * libgomp.oacc-c-c++-common/reduction-cplx-flt-2.c: New test.
        * libgomp.oacc-fortran/reduction-9.f90: New test.

2018-06-29  Cesar Philippidis  <cesar@codesourcery.com>
	    James Norris  <jnorris@codesourcery.com>

	* oacc-parallel.c (GOACC_parallel_keyed): Handle Fortran deviceptr
	clause.
	(GOACC_data_start): Likewise.
	* testsuite/libgomp.oacc-fortran/common-block-1.f90: New test.
	* testsuite/libgomp.oacc-fortran/common-block-2.f90: New test.
	* testsuite/libgomp.oacc-fortran/common-block-3.f90: New test.
	* testsuite/libgomp.oacc-fortran/deviceptr-1.f90: New test.

2019-02-12  Julian Brown <julian@codesourcery.com>

	* oacc-cuda.c (acc_set_cuda_stream): Return 0 on error/invalid
	arguments.
	* testsuite/libgomp.oacc-c-c++-common/lib-84.c: Handle unnumbered
	async stream being an alias for a numbered async stream.
	* testsuite/libgomp.oacc-c-c++-common/lib-85.c: Likewise.

2018-10-02  Thomas Schwinge  <thomas@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/routine-3.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/routine-bind-nohost-1.c:
	Update test.
	* testsuite/libgomp.oacc-fortran/routine-6.f90: Likewise.

2018-10-16  Chung-Lin Tang  <cltang@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/da-1.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/da-2.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/da-3.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/da-4.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/da-utils.h: New test.

2018-10-16  Chung-Lin Tang  <cltang@codesourcery.com>

	* target.c (struct da_dim): New struct declaration.
	(struct da_descr_type): Likewise.
	(struct da_info): Likewise.
	(gomp_dynamic_array_count_rows): New function.
	(gomp_dynamic_array_compute_info): Likewise.
	(gomp_dynamic_array_fill_rows_1): Likewise.
	(gomp_dynamic_array_fill_rows): Likewise.
	(gomp_dynamic_array_create_ptrblock): Likewise.
	(gomp_map_vars): Add code to handle dynamic array map kinds.

2019-01-31  Julian Brown  <julian@codesourcery.com>

	* testsuite/libgomp.oacc-c++/deep-copy-12.C: New test.
	* testsuite/libgomp.oacc-c++/deep-copy-13.C: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-9.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-11.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-14.c: New test.

2018-11-28  Julian Brown  <julian@codesourcery.com>

	* libgomp.h (RC_CHECKING): New macro, disabled by default, guarding all
	hunks in this patch.
	(target_mem_desc): Add forward declaration.
	(async_tgt_use): New struct.
	(target_mem_desc): Add refcount_chk, mark fields.
	(acc_dispatch_t): Add tgt_uses, au_lock fields.
	(dump_tgt, gomp_rc_check): Add prototypes.
	* oacc-async (goacc_async_unmap_tgt): Add refcount self-check code.
	(goacc_async_copyout_unmap_vars): Likewise.
	(goacc_remove_var_async): Likewise.
	* oacc-parallel.c (GOACC_parallel_keyed_internal): Add refcount
	self-check code.
	(GOACC_data_start, GOACC_data_end, GOACC_enter_exit_data): Likewise.
	* target.c (stdio.h): Include.
	(dump_tgt, rc_check_clear, rc_check_count, rc_check_verify)
	(gomp_rc_check): New functions to consistency-check reference counts.
	(gomp_target_init): Initialise self-check-related device fields.

2018-12-14  Julian Brown  <julian@codesourcery.com>

	* libgomp.h (struct target_var_desc): Add do_detach flag.
	(VREFCOUNT_LINK_KEY): New macro.
	(struct splay_tree_key_s): Put link_key and new attach_count field into
	a new union.  Substitute dynamic_refcount field for virtual_refcount.
	(struct acc_dispatch_t): Remove data_environ field.
	(enum gomp_map_vars_kind): Add GOMP_MAP_VARS_OPENACC_ENTER_DATA.
	(gomp_acc_insert_pointer): Remove prototype.
	(gomp_acc_remove_pointer): Update prototype.
	(struct gomp_coalesce_buf): Add forward declaration.
	(gomp_map_val, gomp_attach_pointer, gomp_detach_pointer): Add
	prototypes.
	* libgomp.map (OACC_2.6): New section. Add acc_attach, acc_attach_async,
	acc_detach, acc_detach_async, acc_detach_finalize,
	acc_detach_finalize_async.
	* oacc-async.c (goacc_remove_var_async): New function.
	* oacc-host.c (host_dispatch): Don't initialise removed data_environ
	field.
	* oacc-init.c (acc_shutdown_1): Use gomp_remove_var instead of
	gomp_unmap_vars to remove mappings by splay tree key instead of target
	memory descriptor.
	* oacc-int.h (splay_tree_key_s): Add forward declaration.
	(goacc_remove_var_async): Add prototype.
	* oacc-mem.c (lookup_dev_1): New function.
	(lookup_dev): Reimplement using above.
	(acc_free, acc_hostptr): Update calls to lookup_dev.
	(acc_map_data): Likewise.  Don't add to data_environ list.
	(acc_unmap_data): Remove call to gomp_unmap_vars.  Fix semantics to
	remove mapping, but not mapped data.
	(present_create_copy): Use virtual_refcount instead of
	dynamic_refcount.  Don't manipulate data_environ.  Fix target pointer
	return value.
	(delete_copyout): Update for virtual_refcount semantics.  Use
	goacc_remove_var_async for asynchronous delete/copyouts.
	(gomp_acc_insert_pointer): Remove function.
	(gomp_acc_remove_pointer): Reimplement.
	(acc_attach_async, acc_attach, goacc_detach_internal, acc_detach)
	(acc_detach_async, acc_detach_finalize, acc_detach_finalize_async): New
	functions.
	* oacc-parallel.c (find_pointer): Support attach/detach.  Make a little
	more strict.
	(GOACC_parallel_keyed): Use gomp_map_val to calculate device addresses.
	(GOACC_enter_exit_data): Support attach/detach and GOMP_MAP_STRUCT.
	Don't call gomp_acc_insert_pointer.
	* openacc.h (acc_attach, acc_attach_async, acc_detach)
	(acc_detach_async, acc_detach_finalize, acc_detach_finalize_async): Add
	prototypes.
	* target.c (gomp_map_vars_existing): Initialise do_detach field of
	tgt_var_desc.
	(gomp_attach_pointer, gomp_detach_pointer): New functions.
	(gomp_map_val): Make global.
	(gomp_map_vars_async): Handle GOMP_MAP_VARS_OPENACC_ENTER_DATA.  Update
	for virtual_refcount semantics.  Support attach and detach.
	(gomp_remove_var): Free attach count array if present.
	(gomp_unmap_vars_async): Support detach and update for virtual_refcount
	semantics.  Disambiguate link_key/attach_count using virtual_refcount
	with magic value as a tag.
	(gomp_load_image_to_device): Zero-initialise virtual_refcount fields.
	(gomp_free_memmap): Remove function.
	(gomp_exit_data): Check virtual_refcount for tag value before using
	link_key.
	(omp_target_associate_ptr): Zero-initialise virtual_refcount and
	link_key splay tree key fields.
	(gomp_target_init): Don't initialise removed data_environ field.
	* testsuite/libgomp.oacc-c-c++-common/context-2.c: Use correct API to
	deallocate acc_copyin'd data.
	* testsuite/libgomp.oacc-c-c++-common/context-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-1.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-2.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-3.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-4.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-5.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-6.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-7.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-8.c: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-1.c: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-2.c: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-3.c: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-4.c: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-5.c: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-6.c: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-7.c: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-8.c: New test.
	* testsuite/libgomp.oacc-fortran/data-2.f90: Update test.
	* testsuite/libgomp.oacc-fortran/derived-type-1.f90: New test.
	* testsuite/libgomp.oacc-fortran/update-2.f90: New test.

2018-11-10  Julian Brown  <julian@codesourcery.com>

	* libgomp.h (OFFSET_INLINED, OFFSET_POINTER, OFFSET_STRUCT): Define.
	* target.c (FIELD_TGT_EMPTY): Define.
	(gomp_map_val): Use OFFSET_* macros instead of magic constants.  Write
	as switch instead of list of ifs.
	(gomp_map_vars_internal): Use OFFSET_* and FIELD_TGT_EMPTY macros.

2019-02-26  Chung-Lin Tang  <cltang@codesourcery.com>

	* target.c (goacc_device_copy_async): New function.
	(gomp_copy_host2dev): Remove 'static', add goacc_asyncqueue parameter,
	add goacc_device_copy_async case.
	(gomp_copy_dev2host): Likewise.
	(gomp_map_vars_existing): Add goacc_asyncqueue parameter, adjust code.
	(gomp_map_pointer): Likewise.
	(gomp_map_fields_existing): Likewise.
	(gomp_map_vars_internal): New always_inline function, renamed from
	gomp_map_vars.
	(gomp_map_vars): Implement by calling gomp_map_vars_internal.
	(gomp_map_vars_async): Implement by calling gomp_map_vars_internal,
	passing goacc_asyncqueue argument.
	(gomp_unmap_tgt): Remove statis, add attribute_hidden.
	(gomp_unmap_vars_internal): New always_inline function, renamed from
	gomp_unmap_vars.
	(gomp_unmap_vars): Implement by calling gomp_unmap_vars_internal.
	(gomp_unmap_vars_async): Implement by calling gomp_unmap_vars_internal,
	passing goacc_asyncqueue argument.
	(gomp_fini_device): New function.
	(gomp_exit_data): Adjust gomp_copy_dev2host call.
	(gomp_load_plugin_for_device): Remove old interface, adjust to load
	new async interface.
	(gomp_target_fini): Adjust code to call gomp_fini_device.

	* oacc-async.c (get_goacc_thread): New function.
	(get_goacc_thread_device): New function.
	(lookup_goacc_asyncqueue): New function.
	(validate_async_val): New function.
	(lookup_goacc_asyncqueue): New function.
	(get_goacc_asyncqueue): New function.
	(acc_async_test): Adjust code to use new async design.
	(acc_async_test_all): Likewise.
	(acc_wait): Likewise.
	(acc_wait_async): Likewise.
	(acc_wait_all): Likewise.
	(acc_wait_all_async): Likewise.
	(acc_get_default_async): New API function.
	(acc_set_default_async): Likewise.
	(goacc_async_unmap_tgt): New function.
	(goacc_async_copyout_unmap_vars): Likewise.
	(goacc_async_free): Likewise.
	(goacc_init_asyncqueues): Likewise.
	(goacc_fini_asyncqueues): Likewise.

	* oacc-cuda.c (acc_get_cuda_stream): Adjust code to use new async
	design.
	(acc_set_cuda_stream): Likewise.

	* oacc-host.c (host_version): Update to return GOMP_PLUGIN_IF_VERSION.
	(host_openacc_exec): Adjust parameters, remove 'async'.
	(host_openacc_register_async_cleanup): Remove.
	(host_openacc_async_exec): New function.
	(host_openacc_async_test): Adjust parameters.
	(host_openacc_async_test_all): Remove.
	(host_openacc_async_wait): Remove.
	(host_openacc_async_wait_async): Remove.
	(host_openacc_async_wait_all): Remove.
	(host_openacc_async_wait_all_async): Remove.
	(host_openacc_async_set_async): Remove.
	(host_openacc_async_synchronize): New function.
	(host_openacc_async_serialize): New function.
	(host_openacc_async_host2dev): New function.
	(host_openacc_async_dev2host): New function.
	(host_openacc_async_queue_callback): New function.
	(host_openacc_async_construct): New function.
	(host_openacc_async_destruct): New function.
	(struct gomp_device_descr host_dispatch): Remove initialization of old
	interface, add intialization of new async sub-struct.

	* oacc-init.c (acc_shutdown_1): Adjust to use gomp_fini_device.
	(goacc_attach_host_thread_to_device): Remove old async code usage, add
	initialization of per-thread default_async.

	* oacc-int.h (goacc_init_asyncqueues): New declaration.
	(goacc_fini_asyncqueues): Likewise.
	(goacc_async_free): Likewise.
	(get_goacc_asyncqueue): Likewise.
	(lookup_goacc_asyncqueue): Likewise.

	* oacc-mem.c (memcpy_tofrom_device): Adjust code to use new async
	design.
	(present_create_copy): Likewise.
	(delete_copyout): Likewise.
	(update_dev_host): Likewise.
	(gomp_acc_insert_pointer): Add async parameter, adjust code to use new
	async design.
	(gomp_acc_remove_pointer): Adjust code to use new async design.

	* oacc-parallel.c (GOACC_parallel_keyed): Likewise.
	(GOACC_enter_exit_data): Likewise.
	(goacc_wait): Likewise.
	(GOACC_update): Likewise.

	* oacc-plugin.c (GOMP_PLUGIN_async_unmap_vars): Change to assert fail
	when called, warn as obsolete in comment.

	* libgomp-plugin.h (struct goacc_asyncqueue): Declare.
	(struct goacc_asyncqueue_list): Likewise.
	(goacc_aq): Likewise.
	(goacc_aq_list): Likewise.
	(GOMP_OFFLOAD_openacc_register_async_cleanup): Remove.
	(GOMP_OFFLOAD_openacc_async_test): Remove.
	(GOMP_OFFLOAD_openacc_async_test_all): Remove.
	(GOMP_OFFLOAD_openacc_async_wait): Remove.
	(GOMP_OFFLOAD_openacc_async_wait_async): Remove.
	(GOMP_OFFLOAD_openacc_async_wait_all): Remove.
	(GOMP_OFFLOAD_openacc_async_wait_all_async): Remove.
	(GOMP_OFFLOAD_openacc_async_set_async): Remove.
	(GOMP_OFFLOAD_openacc_exec): Adjust declaration.
	(GOMP_OFFLOAD_openacc_cuda_get_stream): Likewise.
	(GOMP_OFFLOAD_openacc_cuda_set_stream): Likewise.
	(GOMP_OFFLOAD_openacc_async_exec): Declare.
	(GOMP_OFFLOAD_openacc_async_construct): Declare.
	(GOMP_OFFLOAD_openacc_async_destruct): Declare.
	(GOMP_OFFLOAD_openacc_async_test): Declare.
	(GOMP_OFFLOAD_openacc_async_synchronize): Declare.
	(GOMP_OFFLOAD_openacc_async_serialize): Declare.
	(GOMP_OFFLOAD_openacc_async_queue_callback): Declare.
	(GOMP_OFFLOAD_openacc_async_host2dev): Declare.
	(GOMP_OFFLOAD_openacc_async_dev2host): Declare.

	* openacc.h (acc_async_t): Add acc_async_default enum.
	(acc_set_default_async): Declare API function.
	(acc_get_default_async): Likewise.

	* libgomp.h (struct acc_dispatch_t): Define 'async' sub-struct.
	Delete register_async_cleanup_func, async_test_func,
	async_test_all_func, async_wait_func, async_wait_async_func,
	async_wait_all_func, async_wait_all_async_func, async_set_async_func
	hook fields.
	(gomp_acc_insert_pointer): Adjust declaration.
	(gomp_copy_host2dev): New declaration.
	(gomp_copy_dev2host): Likewise.
	(gomp_map_vars_async): Likewise.
	(gomp_unmap_tgt): Likewise.
	(gomp_unmap_vars_async): Likewise.
	(gomp_fini_device): Likewise.

	* libgomp.map (OACC_2.5): Add acc_get_default_async,
	acc_get_default_async_h_, acc_set_default_async, and
	acc_set_default_async_h_.

	* openacc.f90 (acc_async_default): Declare.
	(acc_set_default_async): Likewise.
	(acc_get_default_async): Likewise.

	* openacc_lib.h (acc_async_default): Declare.
	 (acc_set_default_async): Likewise.
	(acc_get_default_async): Likewise.

	* plugin/plugin-hsa.c (GOMP_OFFLOAD_version): Update to return
	GOMP_PLUGIN_IF_VERSION.

	* plugin/plugin-nvptx.c (struct cuda_map): Remove.
	(struct ptx_stream): Remove.
	(struct nvptx_thread): Remove current_stream field.
	(cuda_map_create): Remove.
	(cuda_map_destroy): Remove.
	(map_init): Remove.
	(map_fini): Remove.
	(map_pop): Remove.
	(map_push): Remove.
	(struct goacc_asyncqueue): Define.
	(struct nvptx_callback): Define.
	(struct ptx_free_block): Define.
	(struct ptx_device): Remove null_stream, active_streams, async_streams,
	stream_lock, and next fields.
	(enum ptx_event_type): Remove.
	(struct ptx_event): Remove.
	(ptx_event_lock): Remove.
	(ptx_events): Remove.
	(init_streams_for_device): Remove.
	(fini_streams_for_device): Remove.
	(select_stream_for_async): Remove.
	(nvptx_init): Remove ptx_events and ptx_event_lock references.
	(nvptx_attach_host_thread_to_device): Remove CUDA_ERROR_NOT_PERMITTED
	case.
	(nvptx_open_device): Add free_blocks initialization, remove
	init_streams_for_device call.
	(nvptx_close_device): Remove fini_streams_for_device call, add
	free_blocks destruct code.
	(event_gc): Remove.
	(event_add): Remove.
	(nvptx_exec): Adjust parameters and code.
	(nvptx_free): Likewise.
	(nvptx_host2dev): Remove.
	(nvptx_dev2host): Remove.
	(nvptx_set_async): Remove.
	(nvptx_async_test): Remove.
	(nvptx_async_test_all): Remove.
	(nvptx_wait): Remove.
	(nvptx_wait_async): Remove.
	(nvptx_wait_all): Remove.
	(nvptx_wait_all_async): Remove.
	(nvptx_get_cuda_stream): Remove.
	(nvptx_set_cuda_stream): Remove.
	(GOMP_OFFLOAD_alloc): Adjust code.
	(GOMP_OFFLOAD_free): Likewise.
	(GOMP_OFFLOAD_openacc_register_async_cleanup): Remove.
	(GOMP_OFFLOAD_openacc_exec): Adjust parameters and code.
	(GOMP_OFFLOAD_openacc_async_test_all): Remove.
	(GOMP_OFFLOAD_openacc_async_wait): Remove.
	(GOMP_OFFLOAD_openacc_async_wait_async): Remove.
	(GOMP_OFFLOAD_openacc_async_wait_all): Remove.
	(GOMP_OFFLOAD_openacc_async_wait_all_async): Remove.
	(GOMP_OFFLOAD_openacc_async_set_async): Remove.
	(cuda_free_argmem): New function.
	(GOMP_OFFLOAD_openacc_async_exec): New plugin hook function.
	(GOMP_OFFLOAD_openacc_create_thread_data): Adjust code.
	(GOMP_OFFLOAD_openacc_cuda_get_stream): Adjust code.
	(GOMP_OFFLOAD_openacc_cuda_set_stream): Adjust code.
	(GOMP_OFFLOAD_openacc_async_construct): New plugin hook function.
	(GOMP_OFFLOAD_openacc_async_destruct): New plugin hook function.
	(GOMP_OFFLOAD_openacc_async_test): Remove and re-implement.
	(GOMP_OFFLOAD_openacc_async_synchronize): New plugin hook function.
	(GOMP_OFFLOAD_openacc_async_serialize): New plugin hook function.
	(GOMP_OFFLOAD_openacc_async_queue_callback): New plugin hook function.
	(cuda_callback_wrapper): New function.
	(cuda_memcpy_sanity_check): New function.
	(GOMP_OFFLOAD_host2dev): Remove and re-implement.
	(GOMP_OFFLOAD_dev2host): Remove and re-implement.
	(GOMP_OFFLOAD_openacc_async_host2dev): New plugin hook function.
	(GOMP_OFFLOAD_openacc_async_dev2host): New plugin hook function.

	* testsuite/libgomp.oacc-c-c++-common/asyncwait-2.c: New testcase.
	* testsuite/libgomp.oacc-c-c++-common/lib-81.c: Adjust testcase.
	* testsuite/libgomp.oacc-fortran/lib-12.f90: Likewise.

2018-05-20  Thomas Schwinge  <thomas@codesourcery.com>

	PR libgomp/81886
	* openacc.h (enum acc_device_t): Add _acc_device_intel_mic,
	_acc_device_hsa.
	* oacc-init.c (get_openacc_name): Handle these.
	(resolve_device): Debugging output.
	* target.c (resolve_device, gomp_init_device)
	(gomp_offload_target_available_p): Likewise.
	(GOMP_set_offload_targets): Rewrite.
	* testsuite/libgomp.oacc-c++/c++.exp: Provide offload target in
	"-DACC_DEVICE_TYPE_host", and "-DACC_DEVICE_TYPE_nvidia".
	* testsuite/libgomp.oacc-c/c.exp: Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
	* testsuite/libgomp.oacc-c/offload-targets-1.c: New file.
	* testsuite/libgomp.oacc-c/offload-targets-2.c: Likewise.
	* testsuite/libgomp.oacc-c/offload-targets-3.c: Likewise.
	* testsuite/libgomp.oacc-c/offload-targets-4.c: Likewise.
	* testsuite/libgomp.oacc-c/offload-targets-5.c: Likewise.
	* testsuite/libgomp.oacc-c/offload-targets-6.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c: Adjust.
	* testsuite/libgomp.oacc-c-c++-common/acc_on_device-1.c: Likewise.
	* testsuite/libgomp.oacc-fortran/acc_on_device-1-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/acc_on_device-1-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/acc_on_device-1-3.f: Likewise.

2017-05-14  Thomas Schwinge  <thomas@codesourcery.com>

	PR libgomp/81886
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Adapt.

2015-08-20  Thomas Schwinge  <thomas@codesourcery.com>
	    Joseph Myers  <joseph@codesourcery.com>

	PR libgomp/81886
	* plugin/configfrag.ac (tgt_name): Do not set.
	(offload_targets): Separate with colons not commas.
	* config.h.in, configure: Regenerate.
	* libgomp.h (gomp_offload_target_available_p): New prototype.
	* libgomp.map (GOACC_2.0.GOMP_4_BRANCH): Add
	GOMP_set_offload_targets.
	* libgomp_g.h (GOMP_set_offload_targets): New prototype.
	* oacc-init.c (resolve_device): Use
	gomp_offload_target_available_p.
	* target.c (resolve_device): Use host fallback when offload data
	not available.
	(gomp_offload_target_available_p, offload_target_to_plugin_name)
	(gomp_offload_targets, gomp_offload_targets_init)
	(GOMP_set_offload_targets, gomp_plugin_prefix)
	(gomp_plugin_suffix): New.
	(gomp_load_plugin_for_device): Add gomp_debug call.
	(gomp_target_init): Use gomp_offload_targets instead of
	OFFLOAD_TARGETS.  Handle and rewrie colon-separated string.
	* testsuite/lib/libgomp.exp: Expect offload targets to be
	colon-separated.  Adjust matching of offload targets.
	(libgomp_init)
	(check_effective_target_openacc_nvidia_accel_configured)
	(check_effective_target_openacc_host_selected): Adjust checks of
	offload target names.
	* testsuite/libgomp.oacc-c++/c++.exp: Adjust set of offload
	targets.  Use -foffload instead of setenv ACC_DEVICE_TYPE.
	* testsuite/libgomp.oacc-c/c.exp: Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.