Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

strange conversion by dpct

Shukla__Gagandeep
1,050 Views

Hi,

I was converting cycles folder from blender repo and I noticed a strange conversion done for /cycles/util/util_math.h file.

Source is (line 326):

ccl_device_inline int floor_to_int(float f)
{
  return float_to_int(floorf(f));
}

And it gets converted to:

ccl_device_inline int floor_to_int(float f)
{
  return float_to_int(
      floorf(f) sycl::floor(f) sycl::floor(f) floorf(f) floorf(f) floorf(
          f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(f)
          floorf(f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(
              f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(f)
              floorf(f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(
                  f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(f)
                  floorf(f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(
                      f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(f)
                      floorf(f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(
                          f) floorf(f) floorf(f) floorf(f) floorf(f) floorf(f)
                          floorf(f) floorf(f) floorf(f) floorf(f) floorf(f)
                              floorf(f) floorf(f) floorf(f) floorf(f) floorf(f)
                                  floorf(f) floorf(f) floorf(f) floorf(f)
                                      floorf(f) floorf(f) floorf(f) floorf(f)
                                          floorf(f) floorf(f) floorf(f)
                                              floorf(f) floorf(f) floorf(f)
                                                  floorf(f) floorf(f) floorf(f)
                                                      floorf(f) floorf(f));
}

There are several other such cases too like for (line 342)

ccl_device_inline int ceil_to_int(float f)
{
  return float_to_int(ceilf(f));
}

Converted code is;

ccl_device_inline int ceil_to_int(float f)
{
  return float_to_int(
      ceilf(f) sycl::ceil(f) sycl::ceil(f) ceilf(f) ceilf(f) ceilf(f) ceilf(
          f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f)
          ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(
              f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f)
              ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(
                  f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f)
                  ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(
                      f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f)
                      ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f)
                          ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f)
                              ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f)
                                  ceilf(f) ceilf(f) ceilf(f) ceilf(f) ceilf(f)
                                      ceilf(f) ceilf(f) ceilf(f) ceilf(f)
                                          ceilf(f) ceilf(f) ceilf(f) ceilf(f)
                                              ceilf(f) ceilf(f) ceilf(f)
                                                  ceilf(f) ceilf(f) ceilf(f)
                                                      ceilf(f) ceilf(f));
}

dpct version: Intel(R) DPC++ Compatibility Tool Version: 2021.1-beta08 codebase:(e0b12aa57579014d41e1cd86ecbaaee7de878ce8)

Converted code looks weird.

Source files are attached for reference.

Regards,
Gagan

 

 

0 Kudos
0 Replies
Reply