jansel / opentuner

An extensible framework for program autotuning
http://opentuner.org/
MIT License
382 stars 112 forks source link

PowerOfTwoParameter search_space_size is returning wrong value #143

Closed thiagotei closed 3 years ago

thiagotei commented 3 years ago

The PowerOfTwoParamenter search_space_size is returning wrong value.

The current implementation is return int(math.log(super(PowerOfTwoParameter, self).search_space_size(), 2)) but I believe it should be return int(math.log(self.max_value,2) - math.log(self.min_value, 2)) + 1

For instance, for a PowerOfTwoParameter(k, 2, 32) it returns 4 but should return 5.

jansel commented 3 years ago

I think you are right. Want to submit a PR to fix it?

thiagotei commented 3 years ago

Yes, I will work on it.