@@ -2380,6 +2380,17 @@ is unspecified and is therefore considered infinite.
2380
2380
In case of ivdep being applied both w/o an array variable and for a particular
2381
2381
array, the array variables that were not designated a separate ivdep will receive
2382
2382
the no-array ivdep's safelen, with the correspondent treatment by the backend.
2383
+
2384
+ .. code-block:: c++
2385
+
2386
+ void foo() {
2387
+ int a[10];
2388
+ [[intel::ivdep]] for (int i = 0; i != 10; ++i) { }
2389
+ [[intel::ivdep(2)]] for (int i = 0; i != 10; ++i) { }
2390
+ [[intel::ivdep(a)]] for (int i = 0; i != 10; ++i) { }
2391
+ [[intel::ivdep(a, 2)]] for (int i = 0; i != 10; ++i) { }
2392
+ }
2393
+
2383
2394
}];
2384
2395
}
2385
2396
@@ -2390,6 +2401,14 @@ def SYCLIntelFPGAIIAttrDocs : Documentation {
2390
2401
This attribute applies to a loop. Indicates that the loop should be pipelined
2391
2402
with an initiation interval of N. N must be a positive integer. Cannot be
2392
2403
applied multiple times to the same loop.
2404
+
2405
+ .. code-block:: c++
2406
+
2407
+ void foo() {
2408
+ int var = 0;
2409
+ [[intel::ii(4)]] for (int i = 0; i < 10; ++i) var++;
2410
+ }
2411
+
2393
2412
}];
2394
2413
}
2395
2414
@@ -2401,6 +2420,14 @@ This attribute applies to a loop. Indicates that the loop should allow no more
2401
2420
than N threads or iterations to execute it simultaneously. N must be a non
2402
2421
negative integer. '0' indicates the max_concurrency case to be unbounded. Cannot
2403
2422
be applied multiple times to the same loop.
2423
+
2424
+ .. code-block:: c++
2425
+
2426
+ void foo() {
2427
+ int a[10];
2428
+ [[intel::max_concurrency(2)]] for (int i = 0; i != 10; ++i) a[i] = 0;
2429
+ }
2430
+
2404
2431
}];
2405
2432
}
2406
2433
@@ -2412,6 +2439,14 @@ This attribute applies to a loop. Indicates that the loop nest should be
2412
2439
coalesced into a single loop without affecting functionality. Parameter N is
2413
2440
optional. If specified, it shall be a positive integer, and indicates how many
2414
2441
of the nested loop levels should be coalesced.
2442
+
2443
+ .. code-block:: c++
2444
+
2445
+ void foo() {
2446
+ int a[10];
2447
+ [[intel::loop_coalesce]] for (int i = 0; i != 10; ++i) a[i] = 0;
2448
+ }
2449
+
2415
2450
}];
2416
2451
}
2417
2452
@@ -2423,6 +2458,14 @@ This attribute applies to a loop. Disables pipelining of the loop data path,
2423
2458
causing the loop to be executed serially. Cannot be used on the same loop in
2424
2459
conjunction with max_interleaving, speculated_iterations, max_concurrency, ii
2425
2460
or ivdep.
2461
+
2462
+ .. code-block:: c++
2463
+
2464
+ void foo() {
2465
+ int var = 0;
2466
+ [[intel::disable_loop_pipelining] for (int i = 0; i < 10; ++i) var++;
2467
+ }
2468
+
2426
2469
}];
2427
2470
}
2428
2471
@@ -2436,6 +2479,14 @@ mean that this attribute can only be applied to inner loops in user code - outer
2436
2479
loops in user code may still be contained in an implicit loop due to NDRange).
2437
2480
Parameter N is mandatory, and shall be non-negative integer. Cannot be
2438
2481
used on the same loop in conjunction with disable_loop_pipelining.
2482
+
2483
+ .. code-block:: c++
2484
+
2485
+ void foo() {
2486
+ int a[10];
2487
+ [[intel::max_interleaving(4)]] for (int i = 0; i != 10; ++i) a[i] = 0;
2488
+ }
2489
+
2439
2490
}];
2440
2491
}
2441
2492
@@ -2448,6 +2499,15 @@ iterations that will be in flight for a loop invocation (i.e. the exit
2448
2499
condition for these iterations will not have been evaluated yet).
2449
2500
Parameter N is mandatory, and may either be 0, or a positive integer. Cannot be
2450
2501
used on the same loop in conjunction with disable_loop_pipelining.
2502
+
2503
+ .. code-block:: c++
2504
+
2505
+ void foo() {
2506
+ int var = 0;
2507
+ [[intel::speculated_iterations(4)]]
2508
+ for (int i = 0; i < 10; ++i) var++;
2509
+ }
2510
+
2451
2511
}];
2452
2512
}
2453
2513
@@ -2457,6 +2517,13 @@ def SYCLIntelFPGANofusionAttrDocs : Documentation {
2457
2517
let Content = [{
2458
2518
This attribute applies to a loop. Indicates that the annotated
2459
2519
loop should not be fused with any adjacent loop.
2520
+
2521
+ .. code-block:: c++
2522
+
2523
+ void foo() {
2524
+ [[intel::nofusion]] for (int i=0; i<10;++i) { }
2525
+ }
2526
+
2460
2527
}];
2461
2528
}
2462
2529
0 commit comments