Skip to content

Commit c00f1de

Browse files
authored
[CINN]disable float auto simplify (#64791) (#65075)
* disable float auto simplify * fix unit test bug * fix unit tset bug
1 parent a623686 commit c00f1de

File tree

11 files changed

+48
-48
lines changed

11 files changed

+48
-48
lines changed

paddle/cinn/backends/ir_schedule_test.cc

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ void test_cache_read1(void* _args, int32_t num_args)
13981398
};
13991399
for (int32_t i = 0; i < 32; i += 1) {
14001400
for (int32_t j = 0; j < 32; j += 1) {
1401-
B[((32 * i) + j)] = (2.00000000f * A_local_temp_buffer[((64 * i) + j)]);
1401+
B[((32 * i) + j)] = (A_local_temp_buffer[((64 * i) + j)] * 2.00000000f);
14021402
};
14031403
};
14041404
for (int32_t cache_ax0_0 = 0; cache_ax0_0 < 16; cache_ax0_0 += 1) {
@@ -1408,7 +1408,7 @@ void test_cache_read1(void* _args, int32_t num_args)
14081408
};
14091409
for (int32_t i = 0; i < 16; i += 1) {
14101410
for (int32_t j = 0; j < 16; j += 1) {
1411-
C[((16 * i) + j)] = (1.00000000f + B_local_temp_buffer[((32 * i) + j)]);
1411+
C[((16 * i) + j)] = (B_local_temp_buffer[((32 * i) + j)] + 1.00000000f);
14121412
};
14131413
};
14141414
cinn_buffer_free((void*)(0), _B);
@@ -1480,7 +1480,7 @@ void test_cache_read2(void* _args, int32_t num_args)
14801480
for (int32_t i = 0; i < 64; i += 1) {
14811481
for (int32_t j = 0; j < 32; j += 1) {
14821482
A_local_temp_buffer[((32 * i) + j)] = A[((32 * i) + j)];
1483-
B[((32 * i) + j)] = (2.00000000f * A_local_temp_buffer[((32 * i) + j)]);
1483+
B[((32 * i) + j)] = (A_local_temp_buffer[((32 * i) + j)] * 2.00000000f);
14841484
};
14851485
};
14861486
cinn_buffer_free((void*)(0), _B);
@@ -1553,7 +1553,7 @@ void test_cache_write1(void* _args, int32_t num_args)
15531553
float* C = ((float*)(_C->memory));
15541554
for (int32_t i = 0; i < 64; i += 1) {
15551555
for (int32_t j = 0; j < 32; j += 1) {
1556-
B_local_temp_buffer[((32 * i) + j)] = (2.00000000f * A[((32 * i) + j)]);
1556+
B_local_temp_buffer[((32 * i) + j)] = (A[((32 * i) + j)] * 2.00000000f);
15571557
};
15581558
};
15591559
for (int32_t cache_ax0 = 0; cache_ax0 < 64; cache_ax0 += 1) {
@@ -1563,7 +1563,7 @@ void test_cache_write1(void* _args, int32_t num_args)
15631563
};
15641564
for (int32_t i = 0; i < 64; i += 1) {
15651565
for (int32_t j = 0; j < 32; j += 1) {
1566-
C_local_temp_buffer[((32 * i) + j)] = (1.00000000f + B[((32 * i) + j)]);
1566+
C_local_temp_buffer[((32 * i) + j)] = (B[((32 * i) + j)] + 1.00000000f);
15671567
};
15681568
};
15691569
for (int32_t cache_ax0_0 = 0; cache_ax0_0 < 64; cache_ax0_0 += 1) {
@@ -1637,7 +1637,7 @@ void test_cache_write2(void* _args, int32_t num_args)
16371637
float* B = ((float*)(_B->memory));
16381638
for (int32_t cache_ax0 = 0; cache_ax0 < 64; cache_ax0 += 1) {
16391639
for (int32_t cache_ax1 = 0; cache_ax1 < 32; cache_ax1 += 1) {
1640-
B_local_temp_buffer[((32 * cache_ax0) + cache_ax1)] = (2.00000000f * A[((32 * cache_ax0) + cache_ax1)]);
1640+
B_local_temp_buffer[((32 * cache_ax0) + cache_ax1)] = (A[((32 * cache_ax0) + cache_ax1)] * 2.00000000f);
16411641
B[((32 * cache_ax0) + cache_ax1)] = B_local_temp_buffer[((32 * cache_ax0) + cache_ax1)];
16421642
};
16431643
};
@@ -1713,7 +1713,7 @@ void test_cache_read3(const float* __restrict__ A, float* __restrict__ C)
17131713
};
17141714
for (int32_t i = 0; i < 32; i += 1) {
17151715
for (int32_t j = 0; j < 32; j += 1) {
1716-
B[((32 * i) + j)] = (2.00000000f * A_local_temp_buffer[((64 * i) + j)]);
1716+
B[((32 * i) + j)] = (A_local_temp_buffer[((64 * i) + j)] * 2.00000000f);
17171717
};
17181718
__syncthreads();
17191719
};
@@ -1725,7 +1725,7 @@ void test_cache_read3(const float* __restrict__ A, float* __restrict__ C)
17251725
for (int32_t i = 0; i < 16; i += 1) {
17261726
__syncthreads();
17271727
for (int32_t j = 0; j < 16; j += 1) {
1728-
C[((16 * i) + j)] = (1.00000000f + B_local_temp_buffer[((32 * i) + j)]);
1728+
C[((16 * i) + j)] = (B_local_temp_buffer[((32 * i) + j)] + 1.00000000f);
17291729
};
17301730
};
17311731
}
@@ -1794,7 +1794,7 @@ void test_cache_write3(const float* __restrict__ A, float* __restrict__ C)
17941794
float* B = _B_temp_buffer;
17951795
for (int32_t i = 0; i < 64; i += 1) {
17961796
for (int32_t j = 0; j < 32; j += 1) {
1797-
B_local_temp_buffer[((32 * i) + j)] = (2.00000000f * A[((32 * i) + j)]);
1797+
B_local_temp_buffer[((32 * i) + j)] = (A[((32 * i) + j)] * 2.00000000f);
17981798
};
17991799
};
18001800
for (int32_t cache_ax0 = 0; cache_ax0 < 64; cache_ax0 += 1) {
@@ -1805,7 +1805,7 @@ void test_cache_write3(const float* __restrict__ A, float* __restrict__ C)
18051805
__syncthreads();
18061806
for (int32_t i = 0; i < 64; i += 1) {
18071807
for (int32_t j = 0; j < 32; j += 1) {
1808-
C_local_temp_buffer[((32 * i) + j)] = (1.00000000f + B[((32 * i) + j)]);
1808+
C_local_temp_buffer[((32 * i) + j)] = (B[((32 * i) + j)] + 1.00000000f);
18091809
};
18101810
};
18111811
__syncthreads();
@@ -1878,7 +1878,7 @@ void test_sync_threads(const float* __restrict__ A, float* __restrict__ C)
18781878
float* B = _B_temp_buffer;
18791879
for (int32_t i = 0; i < 64; i += 1) {
18801880
for (int32_t j = 0; j < 32; j += 1) {
1881-
B_local_temp_buffer[((32 * i) + j)] = (2.00000000f * A[((32 * i) + j)]);
1881+
B_local_temp_buffer[((32 * i) + j)] = (A[((32 * i) + j)] * 2.00000000f);
18821882
};
18831883
};
18841884
for (int32_t cache_ax0 = 0; cache_ax0 < 64; cache_ax0 += 1) {
@@ -1889,7 +1889,7 @@ void test_sync_threads(const float* __restrict__ A, float* __restrict__ C)
18891889
};
18901890
for (int32_t i = 0; i < 64; i += 1) {
18911891
for (int32_t j = 0; j < 32; j += 1) {
1892-
C_local_temp_buffer[((32 * i) + j)] = (1.00000000f + B[((32 * i) + j)]);
1892+
C_local_temp_buffer[((32 * i) + j)] = (B[((32 * i) + j)] + 1.00000000f);
18931893
};
18941894
};
18951895
for (int32_t cache_ax0_0 = 0; cache_ax0_0 < 64; cache_ax0_0 += 1) {
@@ -2716,7 +2716,7 @@ void test_compute_inline1(void* _args, int32_t num_args)
27162716
for (int32_t i = 0; i < 32; i += 1) {
27172717
for (int32_t j = 0; j < 32; j += 1) {
27182718
for (int32_t k = 0; k < 32; k += 1) {
2719-
C[((1024 * i) + ((32 * j) + k))] = fma(2.00000000f, A[((32 * i) + ((1024 * j) + k))], 2.00000000f);
2719+
C[((1024 * i) + ((32 * j) + k))] = ((A[((32 * i) + ((1024 * j) + k))] + 1.00000000f) * 2.00000000f);
27202720
};
27212721
};
27222722
};
@@ -2790,7 +2790,7 @@ void test_compute_inline2(void* _args, int32_t num_args)
27902790
for (int32_t i = 0; i < 32; i += 1) {
27912791
for (int32_t j = 0; j < 32; j += 1) {
27922792
for (int32_t k = 0; k < 32; k += 1) {
2793-
C[((1024 * i) + ((32 * j) + k))] = fma(2.00000000f, A[((1024 * i) + ((32 * j) + k))], 2.00000000f);
2793+
C[((1024 * i) + ((32 * j) + k))] = ((A[((1024 * i) + ((32 * j) + k))] + 1.00000000f) * 2.00000000f);
27942794
};
27952795
};
27962796
};
@@ -2855,7 +2855,7 @@ void test_compute_inline3(const float* __restrict__ A, float* __restrict__ C)
28552855
for (int32_t i = 0; i < 32; i += 1) {
28562856
for (int32_t j = 0; j < 32; j += 1) {
28572857
for (int32_t k = 0; k < 32; k += 1) {
2858-
C[((1024 * i) + ((32 * j) + k))] = (2.00000000f + (2.00000000f * A[((32 * i) + ((1024 * j) + k))]));
2858+
C[((1024 * i) + ((32 * j) + k))] = ((A[((32 * i) + ((1024 * j) + k))] + 1.00000000f) * 2.00000000f);
28592859
};
28602860
};
28612861
};
@@ -2917,7 +2917,7 @@ void test_compute_inline4(const float* __restrict__ A, float* __restrict__ C)
29172917
for (int32_t i = 0; i < 32; i += 1) {
29182918
for (int32_t j = 0; j < 32; j += 1) {
29192919
for (int32_t k = 0; k < 32; k += 1) {
2920-
C[((1024 * i) + ((32 * j) + k))] = (2.00000000f + (2.00000000f * A[((1024 * i) + ((32 * j) + k))]));
2920+
C[((1024 * i) + ((32 * j) + k))] = ((A[((1024 * i) + ((32 * j) + k))] + 1.00000000f) * 2.00000000f);
29212921
};
29222922
};
29232923
};
@@ -2979,7 +2979,7 @@ void test_compute_inline1(void* _args, int32_t num_args)
29792979
float* C = ((float*)(_C->memory));
29802980
for (int32_t i = 0; i < 32; i += 1) {
29812981
for (int32_t j = 0; j < 64; j += 1) {
2982-
C[((32 * j) + i)] = fma(2.00000000f, A[((64 * i) + j)], 2.00000000f);
2982+
C[((32 * j) + i)] = (2.00000000f * (1.00000000f + A[((64 * i) + j)]));
29832983
};
29842984
};
29852985
cinn_buffer_free((void*)(0), _B);
@@ -3047,7 +3047,7 @@ void test_compute_inline1(void* _args, int32_t num_args)
30473047
for (int32_t i = 0; i < 32; i += 1) {
30483048
for (int32_t j = 0; j < 32; j += 1) {
30493049
for (int32_t k = 0; k < 32; k += 1) {
3050-
C[((32 * i) + ((1024 * j) + k))] = fma(2.00000000f, A[((1024 * i) + ((32 * j) + k))], 2.00000000f);
3050+
C[((32 * i) + ((1024 * j) + k))] = (2.00000000f * (1.00000000f + A[((1024 * i) + ((32 * j) + k))]));
30513051
};
30523052
};
30533053
};
@@ -3125,7 +3125,7 @@ void test_copytransform1(void* _args, int32_t num_args)
31253125
for (int32_t j = 0; j < 8; j += 1) {
31263126
for (int32_t j_0 = 0; j_0 < 4; j_0 += 1) {
31273127
for (int32_t k = 0; k < 32; k += 1) {
3128-
B[((8192 * i) + ((1024 * i_0) + ((128 * j) + ((32 * j_0) + k))))] = (1.00000000f + A[((8192 * i) + ((1024 * i_0) + ((128 * j) + ((32 * j_0) + k))))]);
3128+
B[((8192 * i) + ((1024 * i_0) + ((128 * j) + ((32 * j_0) + k))))] = (A[((8192 * i) + ((1024 * i_0) + ((128 * j) + ((32 * j_0) + k))))] + 1.00000000f);
31293129
};
31303130
};
31313131
};
@@ -3136,7 +3136,7 @@ void test_copytransform1(void* _args, int32_t num_args)
31363136
for (int32_t j = 0; j < 8; j += 1) {
31373137
for (int32_t j_0 = 0; j_0 < 4; j_0 += 1) {
31383138
for (int32_t k = 0; k < 32; k += 1) {
3139-
C[((8192 * i) + ((1024 * i_0) + ((128 * j) + ((32 * j_0) + k))))] = (2.00000000f * B[((256 * i) + ((32 * i_0) + ((4096 * j) + ((1024 * j_0) + k))))]);
3139+
C[((8192 * i) + ((1024 * i_0) + ((128 * j) + ((32 * j_0) + k))))] = (B[((256 * i) + ((32 * i_0) + ((4096 * j) + ((1024 * j_0) + k))))] * 2.00000000f);
31403140
};
31413141
};
31423142
};
@@ -3214,7 +3214,7 @@ void test_copytransform2(void* _args, int32_t num_args)
32143214
for (int32_t i_0 = 0; i_0 < 8; i_0 += 1) {
32153215
for (int32_t j = 0; j < 64; j += 1) {
32163216
for (int32_t k = 0; k < 128; k += 1) {
3217-
B[((65536 * i) + ((8192 * i_0) + ((128 * j) + k)))] = (1.00000000f + A[((65536 * i) + ((8192 * i_0) + ((128 * j) + k)))]);
3217+
B[((65536 * i) + ((8192 * i_0) + ((128 * j) + k)))] = (A[((65536 * i) + ((8192 * i_0) + ((128 * j) + k)))] + 1.00000000f);
32183218
};
32193219
};
32203220
};
@@ -3224,7 +3224,7 @@ void test_copytransform2(void* _args, int32_t num_args)
32243224
for (int32_t j = 0; j < 8; j += 1) {
32253225
for (int32_t j_0 = 0; j_0 < 4; j_0 += 1) {
32263226
for (int32_t k = 0; k < 128; k += 1) {
3227-
C[((32768 * i) + ((4096 * i_0) + ((512 * j) + ((128 * j_0) + k))))] = (2.00000000f * B[((65536 * i) + ((8192 * i_0) + ((512 * j) + ((128 * j_0) + k))))]);
3227+
C[((32768 * i) + ((4096 * i_0) + ((512 * j) + ((128 * j_0) + k))))] = (B[((65536 * i) + ((8192 * i_0) + ((512 * j) + ((128 * j_0) + k))))] * 2.00000000f);
32283228
};
32293229
};
32303230
};

paddle/cinn/common/cas.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ Expr AutoSimplify(
3737
Expr u,
3838
const absl::flat_hash_map<std::string, CasInterval>& var_intervals) {
3939
VLOG(7) << "Begin AutoSimplify: " << u;
40+
if (u.type().is_float()) {
41+
return u;
42+
}
4043
u = detail::ConvertCinnToCAS(u);
4144
absl::flat_hash_map<std::string, CasInterval> s_var_intervals;
4245
for (auto& item : var_intervals) {

paddle/cinn/common/cas_test.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,6 @@ TEST(CAS, cond) {
458458
TEST(CAS, SimplifyFracOp) {
459459
Expr frac = Expr(1) / Expr(7) / Expr(6) / Expr(5) / Expr(4);
460460
EXPECT_EQ(GetStreamCnt(AutoSimplify(frac)), "0");
461-
462-
Expr frac_f = Expr(20.0f) / Expr(2.0f) / Expr(1.0f) / Expr(5.0f);
463-
EXPECT_EQ(GetStreamCnt(AutoSimplify(frac_f)), "2.00000000f");
464461
}
465462

466463
} // namespace common

paddle/cinn/ir/test/tensor_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function func_C (_A, _B, _D)
5959
{
6060
serial for (j, 0, 20)
6161
{
62-
D[i, j] = (1.00000000f + ((2.00000000f * A[i, j]) + (2.00000000f * B[i, j])))
62+
D[i, j] = (((A[i, j] + B[i, j]) * 2.00000000f) + 1.00000000f)
6363
}
6464
}
6565
}
@@ -117,7 +117,7 @@ void fn(void* _args, int32_t num_args)
117117
for (int32_t i = 0; i < 10; i += 1) {
118118
for (int32_t j = 0; j < 10; j += 1) {
119119
for (int32_t k = 0; k < 100; k += 1) {
120-
B[((1000 * i) + ((100 * j) + k))] = (2.00000000f * A_reshape[((1000 * i) + ((100 * j) + k))]);
120+
B[((1000 * i) + ((100 * j) + k))] = (A_reshape[((1000 * i) + ((100 * j) + k))] * 2.00000000f);
121121
};
122122
};
123123
};
@@ -175,7 +175,7 @@ void fn(void* _args, int32_t num_args)
175175
for (int32_t i = 0; i < 10; i += 1) {
176176
for (int32_t j = 0; j < 10; j += 1) {
177177
for (int32_t k = 0; k < 100; k += 1) {
178-
B[((1000 * i) + ((100 * j) + k))] = (2.00000000f * A_copied_reshape[((1000 * i) + ((100 * j) + k))]);
178+
B[((1000 * i) + ((100 * j) + k))] = (A_copied_reshape[((1000 * i) + ((100 * j) + k))] * 2.00000000f);
179179
};
180180
};
181181
};

paddle/cinn/lang/lower_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ TEST(lower, basic) {
5353
{
5454
serial for (j, 0, 15)
5555
{
56-
B[i, j] = (1.00000000f + A[i, j])
56+
B[i, j] = (A[i, j] + 1.00000000f)
5757
}
5858
}
5959
}

paddle/cinn/optim/cache_read_write_replace_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function fn (_A, _B, _C1_write_cache)
105105
{
106106
serial for (j, 0, 100)
107107
{
108-
C1_write_cache[i, j] = (3.00000000f + A[i, j])
108+
C1_write_cache[i, j] = (((A[i, j] + 1.00000000f) + 1.00000000f) + 1.00000000f)
109109
}
110110
}
111111
serial for (i, 0, 100)

paddle/cinn/optim/ir_simplify_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ TEST(IrSimplify, basic) {
4141
// get (((C[(i * 20)] + 0) + 100) + 24.5)
4242
Simplify(&B);
4343
LOG(INFO) << "simplified: " << B;
44-
auto out = "(124.500000f + C[i, 0])";
44+
auto out = "(((C[i, 0] + 0.00000000f) + 100.000000f) + 24.5000000f)";
4545
EXPECT_EQ(out, utils::GetStreamCnt(B));
4646
}
4747

@@ -69,7 +69,7 @@ TEST(IrSimplify, basic) {
6969
{
7070
serial for (j, 0, 20)
7171
{
72-
B[i, j] = (125.000000f + (X[i, j] + y[i, 0]))
72+
B[i, j] = ((((((X[i, j] + (y[i, 0] * 1.00000000f)) + (0.00000000f * X[i, j])) + 25.0000000f) + 100.000000f) - 0.00000000f) + 0.00000000f)
7373
}
7474
}
7575
}
@@ -104,7 +104,7 @@ TEST(IrSimplify, basic) {
104104
{
105105
serial for (j, 0, 20)
106106
{
107-
B[i, j] = ((y[i, 0] / 3.00000000f) + (125.000000f + X[(1000 * i), 0]))
107+
B[i, j] = ((((((X[(1000 * i), 0] + (y[i, 0] / 3.00000000f)) + (0.00000000f * X[i, j])) + 25.0000000f) + 100.000000f) - 0.00000000f) + 0.00000000f)
108108
}
109109
}
110110
}

paddle/cinn/optim/optimize_test.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ TEST(Optimize, Unroll) {
4141
{
4242
serial for (j_outer, 0, 4)
4343
{
44-
C[i, (5 * j_outer)] = (1.00000000f + A[i, (5 * j_outer)])
45-
C[i, (1 + (5 * j_outer))] = (1.00000000f + A[i, (1 + (5 * j_outer))])
46-
C[i, (2 + (5 * j_outer))] = (1.00000000f + A[i, (2 + (5 * j_outer))])
47-
C[i, (3 + (5 * j_outer))] = (1.00000000f + A[i, (3 + (5 * j_outer))])
48-
C[i, (4 + (5 * j_outer))] = (1.00000000f + A[i, (4 + (5 * j_outer))])
44+
C[i, (5 * j_outer)] = (A[i, (5 * j_outer)] + 1.00000000f)
45+
C[i, (1 + (5 * j_outer))] = (A[i, (1 + (5 * j_outer))] + 1.00000000f)
46+
C[i, (2 + (5 * j_outer))] = (A[i, (2 + (5 * j_outer))] + 1.00000000f)
47+
C[i, (3 + (5 * j_outer))] = (A[i, (3 + (5 * j_outer))] + 1.00000000f)
48+
C[i, (4 + (5 * j_outer))] = (A[i, (4 + (5 * j_outer))] + 1.00000000f)
4949
}
5050
}
5151
}

paddle/cinn/poly/schedule_test.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ TEST(CreateStages, compute_at) {
4848
{
4949
serial for (j, 0, 100)
5050
{
51-
B[i, j] = (1.00000000f + A[i, j])
51+
B[i, j] = (A[i, j] + 1.00000000f)
5252
serial for (k, 0, 100)
5353
{
5454
C[i, j, k] = (B[i, j] * B[j, k])
@@ -99,21 +99,21 @@ TEST(CreateStages, buffer_bind_to_multiple_tensors_schedule) {
9999
{
100100
serial for (j, 0, 100)
101101
{
102-
B[i, j] = (1.00000000f + A[i, j])
102+
B[i, j] = (A[i, j] + 1.00000000f)
103103
}
104104
}
105105
serial for (i, 0, 100)
106106
{
107107
serial for (j, 0, 100)
108108
{
109-
C[i, j] = (1.00000000f + A[i, j])
109+
C[i, j] = (A[i, j] + 1.00000000f)
110110
}
111111
}
112112
serial for (i, 0, 100)
113113
{
114114
serial for (j, 0, 100)
115115
{
116-
D[i, j] = (1.00000000f + A[i, j])
116+
D[i, j] = (A[i, j] + 1.00000000f)
117117
}
118118
}
119119
}

paddle/cinn/poly/stage_test.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ function fn (_A, _A1, _B)
207207
}
208208
serial for (j, 0, 32)
209209
{
210-
B[((16 * i_outer) + i_inner), j] = (A1[((16 * i_outer) + i_inner), j] + (A1[(1 + ((16 * i_outer) + i_inner)), j] + A1[(2 + ((16 * i_outer) + i_inner)), j]))
210+
B[((16 * i_outer) + i_inner), j] = ((A1[((16 * i_outer) + i_inner), j] + A1[(1 + ((16 * i_outer) + i_inner)), j]) + A1[(2 + ((16 * i_outer) + i_inner)), j])
211211
}
212212
}
213213
}
@@ -431,7 +431,7 @@ function fn (_A, _C)
431431
{
432432
serial for (j, 0, 200)
433433
{
434-
C[i, j] = (6.00000000f + (2.00000000f * A[i, j]))
434+
C[i, j] = ((((A[i, j] + 1.00000000f) + 1.00000000f) + 1.00000000f) * 2.00000000f)
435435
}
436436
}
437437
}
@@ -475,21 +475,21 @@ function fn (_A, _C, _C1, _C2)
475475
{
476476
serial for (j, 0, 200)
477477
{
478-
C2[i, j] = (6.00000000f + (2.00000000f * A[i, j]))
478+
C2[i, j] = ((((A[i, j] + 1.00000000f) + 1.00000000f) + 1.00000000f) * 2.00000000f)
479479
}
480480
}
481481
serial for (i, 0, 100)
482482
{
483483
serial for (j, 0, 200)
484484
{
485-
C1[i, j] = (4.00000000f + (2.00000000f * A[i, j]))
485+
C1[i, j] = (((A[i, j] + 1.00000000f) + 1.00000000f) * 2.00000000f)
486486
}
487487
}
488488
serial for (i, 0, 100)
489489
{
490490
serial for (j, 0, 200)
491491
{
492-
C[i, j] = (2.00000000f + (2.00000000f * A[i, j]))
492+
C[i, j] = ((A[i, j] + 1.00000000f) * 2.00000000f)
493493
}
494494
}
495495
}

0 commit comments

Comments
 (0)