Vista Normal

Hay nuevos artículos disponibles. Pincha para refrescar la página.
AnteayerSalida Principal

Faster Integer Division with Floating Point

23 Diciembre 2024 at 06:00

Multiplication on a common microcontroller is easy. But division is much more difficult. Even with hardware assistance, a 32-bit division on a modern 64-bit x86 CPU can run between 9 and 15 cycles. Doing array processing with SIMD (single instruction multiple data)  instructions like AVX or NEON often don’t offer division at all (although the RISC-V vector extensions do). However, many processors support floating point division. Does it make sense to use floating point division to replace simpler division? According to [Wojciech Mula] in a recent post, the answer is yes.

The plan is simple: cast the 8-bit numbers into 32-bit integers and then to floating point numbers. These can be divided in bulk via the SIMD instructions and then converted in reverse to the 8-bit result. You can find several code examples on GitHub.

Since modern processors have several SIMD instructions, the post takes the time to benchmark many different variations of a program dividing in a loop. The basic program is the reference and, thus, has a “speed factor” of 1. Unrolling the loop, a common loop optimization technique, doesn’t help much and, on some CPUs, can make the loop slower.

Converting to floating point and using AVX2 sped the program up by a factor of 8X to 11X, depending on the CPU.  Some of the processors supported AVX512, which also offered considerable speed-ups.

This is one of those examples of why profiling is so important. If you’d had asked us if converting integer division to floating point might make a program run faster, we’d have bet the answer was no, but we’d have been wrong.

As CPUs get more complex, optimizing gets a lot less intuitive. If you are interested in things like AVX-512, we’ve got you covered.

IndexGuru

Por: EasyWithAI
12 Septiembre 2023 at 16:00
IndexGuru is an easy-to-use website indexing tool that helps you get your pages indexed by search engines like Google faster. It can automatically scan your site every day to check for unindexed pages and submits them to Google for you. The Auto Indexing feature is great for busy webmasters who want to save time submitting […]

Source

Granica

Por: EasyWithAI
27 Agosto 2023 at 13:08
Granica uses AI to optimize efficiency and security for developers and organizations working with huge datasets in the cloud. It’s designed to be easy to use while delivering major cost and privacy benefits. It can compress and screen data, while providing useful insights that can help you to optimize your efficiency and thus lower data […]

Source

QuantPlus

Por: EasyWithAI
26 Mayo 2023 at 12:06
QuantPlus uses AI to optimize ads before launching them. Its breakthrough technology boosts ad performance by analyzing each element, allowing you to create up to 300% more effective ads. By analyzing historical ad data, QuantPlus identifies and ranks high-performing creative elements such as text, images, and more.

Source

Promoted

Por: EasyWithAI
23 Junio 2023 at 17:36
Promoted uses AI to generate optimized ad copy for your online advertising campaigns. Simply put in your website URL or landing page URL and Promoted will auto-generate ad copy variations for your business or product. Every major ad platform is available, and you are able to customize the ad copy tone to best fit your […]

Source

Flowpoint.ai

Por: EasyWithAI
27 Junio 2023 at 13:33
Flowpoint is a tool that uses AI to optimize website conversions, prioritize impactful solutions, and enhance ROI with data-driven decisions. It includes features such as cross-domain funnel tracking, funnel analytics, AI-powered recommendations, conversion rate optimization, and event capturing. It also provides insights, recommendations, and technical errors to help users take meaningful actions to improve website […]

Source

SEOlligence

Por: EasyWithAI
13 Octubre 2023 at 12:27
SEOlligence is an AI-powered tool that translates and fills in the SEO elements of the product page in order to localize your online shop and be product SEO-friendly in each language. With SEOlligence, businesses can improve their search rankings, drive organic traffic, and attract more customers. The tool is compatible with all e-commerce platforms and […]

Source

❌
❌