An Efficient Method for Defining Multivariate Functions Using Expression Templates for Arrays in C++ and CUDA

Message:
Article Type:
Research/Original Article (دارای رتبه معتبر)
Abstract:

In this paper an efficient method for defining multi-variable functions using expression templates for array computations in computational fluid dynamics simulations in C++ is introduced. The method is implemented using variadic templates which is a new feature in C++. One of the advantages of the method is its easy of use for users of computational fields. The user can define and use his own function with any number of input arguments without having knowledge of templates programming concepts. The present method may replace conventional expression templates in developing numerical libraries. For three different functions, including arithmetic operations and trigonometric functions, the efficiency of the proposed method for arrays of different sizes is compared with that of the conventional expression templates, two different C++ syntax and Fortran language. Furthermore, the performance of the method in terms of the compilation time and executable file size is demonstrated. A similar comparison on Graphic Processing Units (GPU) using CUDA is made and the efficiency of the method is shown. The results indicate that, for any array size, the present method has a very good performance in terms of computational time, compilation time and executable file size. Finally, as an application of the proposed method, a numerical simulation is done.

Language:
Persian
Published:
Journal of Modeling in Engineering, Volume:16 Issue: 55, 2019
Pages:
113 to 131
magiran.com/p1959757  
دانلود و مطالعه متن این مقاله با یکی از روشهای زیر امکان پذیر است:
اشتراک شخصی
با عضویت و پرداخت آنلاین حق اشتراک یک‌ساله به مبلغ 1,390,000ريال می‌توانید 70 عنوان مطلب دانلود کنید!
اشتراک سازمانی
به کتابخانه دانشگاه یا محل کار خود پیشنهاد کنید تا اشتراک سازمانی این پایگاه را برای دسترسی نامحدود همه کاربران به متن مطالب تهیه نمایند!
توجه!
  • حق عضویت دریافتی صرف حمایت از نشریات عضو و نگهداری، تکمیل و توسعه مگیران می‌شود.
  • پرداخت حق اشتراک و دانلود مقالات اجازه بازنشر آن در سایر رسانه‌های چاپی و دیجیتال را به کاربر نمی‌دهد.
In order to view content subscription is required

Personal subscription
Subscribe magiran.com for 70 € euros via PayPal and download 70 articles during a year.
Organization subscription
Please contact us to subscribe your university or library for unlimited access!